How to really fill up all screens?
I'm building an application that essentially attempts to fill up all of the user's screens with a maximized form. On most machines this works. I'm simply using My.Computer.Screen.AllScreens enumeration to get a reference to all the user's screens (assuming a multi-screen setup). I'm then using the following to set the forms:
Code:
For i As Integer = 0 To My.Computer.Screen.AllScreens.Count - 1
frm = New BlankForm
BlankScreens.Add(frm)
frm.Location = New Point(My.Computer.Screen.AllScreens(i).Bounds.Left, 0)
frm.Show()
Next
For whatever reason, this is not always working, and only showing on one screen. Is there a better way at accomplishing this?
Re: How to really fill up all screens?
That code doesn't look like a maximized form filling up all screens, it looks like 1 form for each screen...
How does this work for you? It works for me on my 4 LCD setup.
Code:
Public Shared Sub main()
Dim AllScreenSize As Size
Dim LeftMostPosition As Integer = 0
For Each S As Screen In Screen.AllScreens
If S.Bounds.Left < LeftMostPosition Then LeftMostPosition = S.Bounds.Left
AllScreenSize += S.Bounds.Size
Next
Dim frm As New Form1
frm.StartPosition = FormStartPosition.Manual
frm.FormBorderStyle = Windows.Forms.FormBorderStyle.None
frm.WindowState = FormWindowState.Normal
frm.Size = AllScreenSize
frm.Location = New Point(LeftMostPosition, 0)
frm.ShowDialog()
End Sub
Re: How to really fill up all screens?
Quote:
Originally Posted by
kleinma
That code doesn't look like a maximized form filling up all screens, it looks like 1 form for each screen...
How does this work for you? It works for me on my 4 LCD setup.
Code:
Public Shared Sub main()
Dim AllScreenSize As Size
Dim LeftMostPosition As Integer = 0
For Each S As Screen In Screen.AllScreens
If S.Bounds.Left < LeftMostPosition Then LeftMostPosition = S.Bounds.Left
AllScreenSize += S.Bounds.Size
Next
Dim frm As New Form1
frm.StartPosition = FormStartPosition.Manual
frm.FormBorderStyle = Windows.Forms.FormBorderStyle.None
frm.WindowState = FormWindowState.Normal
frm.Size = AllScreenSize
frm.Location = New Point(LeftMostPosition, 0)
frm.ShowDialog()
End Sub
Works on my 2-Screen computer too.
Re: How to really fill up all screens?
Cool, I'll give it a shot and let you know.
Re: How to really fill up all screens?
Does this assume that all screens are the same size? In our environment, they are not, hence the reason why I was instantiating multiple forms.
Re: How to really fill up all screens?
Doesn't work for me. Does this code assume the screen are the same size and resolution? In our environment, they are not.
Re: How to really fill up all screens?
Actually, maybe it does work. I broke this code out into its own application and it does seem to work. There might have been something else in the code preventing this from working correctly. Thanks!