简体   繁体   English

vb.net 确定屏幕

[英]vb.net determine Screen

Is it possible to determine the screen where a form is located?是否可以确定表单所在的屏幕? Not the position or the Size!不是位置或大小!

I used我用了

Dim myScreens() As Screen = Screen.AllScreens

Me.Left = (myScreens(0).WorkingArea.Width - Me.Size.Width) / 2
Me.Top = (myScreens(0).WorkingArea.Height - Me.Size.Height) / 2

to postion the Form.放置表格。 When the user relocates the form onto another screen, I want to save that postion of that new screen!当用户将表单重新定位到另一个屏幕时,我想保存那个新屏幕的位置!

Yes, use Screen.FromControl(Me) .是的,使用Screen.FromControl(Me)

Retrieves a Screen for the display that contains the largest portion of the specified control.检索包含指定控件最大部分的显示器的屏幕。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM