My solution will work also for extended desktops (dual-screen)
''' <summary>
''' Gets the extended screen resolution (for Dual-Screens).
''' </summary>
Private Function GetExtendedScreenResolution() As Point
Dim ResX As Integer =
(From scr As Screen In Screen.AllScreens Select scr.Bounds.Width).Sum
Dim ResY As Integer =
(From scr As Screen In Screen.AllScreens Select scr.Bounds.Height).Sum
Return New Point(ResX, ResY)
End Function
''' <summary>
''' Gets the primary screen resolution.
''' </summary>
Private Function GetPrimaryScreenResolution() As Point
Return New Point(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height)
End Function
Usage Examples:
' Usage Examples:
MsgBox(GetExtendedScreenResolution.ToString)
Dim Resolution as Point = GetExtendedScreenResolution()
Me.Size = GetPrimaryScreenResolution()