Base: add RetoreWindowSize
This commit is contained in:
parent
e156cc9d88
commit
f2e275c8bd
@ -3,6 +3,9 @@ Imports System.Drawing
|
||||
Imports System.Windows.Forms
|
||||
|
||||
Public Class ScreenEx
|
||||
Public Const DEFAULT_WINDOW_HEIGHT = 480
|
||||
Public Const DEFAULT_WINDOW_WIDTH = 640
|
||||
|
||||
Public Shared Function GetLocationWithinScreen(pLocation As Point) As Point?
|
||||
For Each screen As Screen In Screen.AllScreens
|
||||
If screen.Bounds.Contains(pLocation) Then
|
||||
@ -46,6 +49,17 @@ Public Class ScreenEx
|
||||
RestoreFormState(pForm, oFormState)
|
||||
End Sub
|
||||
|
||||
Public Shared Sub RetoreWindowSize(pForm As Form, pFormSize As Size)
|
||||
Dim oFormSize As Size
|
||||
If pFormSize.Height < 1 Or pFormSize.Width < 1 Or pFormSize.IsEmpty Then
|
||||
oFormSize = New Size(DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT)
|
||||
Else
|
||||
oFormSize = pFormSize
|
||||
End If
|
||||
|
||||
pForm.Size = oFormSize
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Checks if a point is Visible on any screen
|
||||
''' </summary>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user