VB.NET 多屏显示

'?? ''' <summary>多屏显示屏幕设置</summary>
'?? ''' <param name="obj">目标窗体</param>
'?? ''' <param name="scrIndex">由0开始的屏幕索引,0为主屏幕</param>
Function ShowScreens(obj As Form, scrIndex As Integer)
Dim arr As Screen() = Screen.AllScreens
If scrIndex < arr.Length Then
obj.Width = arr(scrIndex).Bounds.Width
obj.Height = arr(scrIndex).Bounds.Height
obj.Left = arr(scrIndex).Bounds.X
obj.Top = 0
Else
Dim mess As String = "当前屏幕索引超出范围,是否要显示在最后一个屏幕?"
Dim result As DialogResult =
MessageBox.Show(mess, "信息提示",
MessageBoxButtons.YesNo, MessageBoxIcon.Warning)
If result = Windows.Forms.DialogResult.Yes Then
obj.Width = arr(scrIndex).Bounds.Width
obj.Height = arr(scrIndex).Bounds.Height
obj.Left = arr(arr.Length - 1).Bounds.X
obj.Top = 0
End If
End If
End Function转载请注明出处:

转载自http://lxfamn.cn/blog

未经允许不得转载:lxfamn » VB.NET 多屏显示

赞 (0) 打赏

置顶推荐

评论 0

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏