vb.net确定屏幕 [英] vb.net determine Screen

查看:87
本文介绍了vb.net确定屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以确定表单所在的屏幕?不是位置或大小!

Is it possible to determine the screen where a form is located? Not the position or the Size!

我用过

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).

检索显示的屏幕,其中包含指定控件的最大部分.

Retrieves a Screen for the display that contains the largest portion of the specified control.

这篇关于vb.net确定屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆