A
Allen
How to force System.Windows.Forms.Screen.AllScreens to update when attaching
an additional monitor?
Form1 is Loaded and runs the following upon detection of additional monitor:
Dim Screens() As System.Windows.Forms.Screen
Screens = System.Windows.Forms.Screen.AllScreens
MsgBox("SWFSAsLength: " & System.Windows.Forms.Screen.AllScreens.Length &
vbCr & "Screens: " & Screens.Length)
Output:
WSFSAsLength: 1
Screens: 1
If a message box is displayed prior to setting the Screens variable such as
following then System.Windows.Forms.Screens.AllScreens is updated as
follows:
Dim Screens() As System.Windows.Forms.Screen
MsgBox("anything")
Screens = System.Windows.Forms.Screen.AllScreens
MsgBox("SWFSAsLength: " & System.Windows.Forms.Screen.AllScreens.Length &
vbCr & "Screens: " & Screens.Length)
Output:
WSFSAsLength: 2
Screens: 2
Need to obtain HxV size of each attached monitor. Is there a better way?
an additional monitor?
Form1 is Loaded and runs the following upon detection of additional monitor:
Dim Screens() As System.Windows.Forms.Screen
Screens = System.Windows.Forms.Screen.AllScreens
MsgBox("SWFSAsLength: " & System.Windows.Forms.Screen.AllScreens.Length &
vbCr & "Screens: " & Screens.Length)
Output:
WSFSAsLength: 1
Screens: 1
If a message box is displayed prior to setting the Screens variable such as
following then System.Windows.Forms.Screens.AllScreens is updated as
follows:
Dim Screens() As System.Windows.Forms.Screen
MsgBox("anything")
Screens = System.Windows.Forms.Screen.AllScreens
MsgBox("SWFSAsLength: " & System.Windows.Forms.Screen.AllScreens.Length &
vbCr & "Screens: " & Screens.Length)
Output:
WSFSAsLength: 2
Screens: 2
Need to obtain HxV size of each attached monitor. Is there a better way?