MS 2.4.9.9 Form Position visible area
This commit is contained in:
@@ -413,9 +413,21 @@ Public Class frmMain
|
||||
Timer_Inactivity_Reset_Disable("FormLoad")
|
||||
|
||||
'Restore_Form_Position()
|
||||
ScreenEx.RestoreFormPosition(Me, My.Settings.frmMainPosition)
|
||||
ScreenEx.RestoreFormState(Me, My.Settings.frmMainWindowState)
|
||||
ScreenEx.RestoreFormSize(Me, My.Settings.frmMainSize)
|
||||
Dim oSavedPosition As Point = My.Settings.frmMainPosition
|
||||
|
||||
' Prüfen, ob die Position sichtbar ist
|
||||
If IsPositionVisible(oSavedPosition) Then
|
||||
' Position ist sichtbar, das Formular wird dort angezeigt
|
||||
ScreenEx.RestoreFormPosition(Me, My.Settings.frmMainPosition)
|
||||
ScreenEx.RestoreFormState(Me, My.Settings.frmMainWindowState)
|
||||
ScreenEx.RestoreFormSize(Me, My.Settings.frmMainSize)
|
||||
Else
|
||||
' Position ist unsichtbar, Standardposition verwenden
|
||||
Me.StartPosition = FormStartPosition.CenterScreen
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If IDB_ACTIVE = False And ERROR_STATE = "" Then
|
||||
Try
|
||||
@@ -481,7 +493,14 @@ Public Class frmMain
|
||||
|
||||
FormOpenClose = False
|
||||
End Sub
|
||||
|
||||
Private Function IsPositionVisible(position As Point) As Boolean
|
||||
For Each scr As Screen In Screen.AllScreens
|
||||
If scr.WorkingArea.Contains(position) Then
|
||||
Return True ' Punkt ist sichtbar
|
||||
End If
|
||||
Next
|
||||
Return False ' Punkt ist außerhalb aller sichtbaren Bereiche
|
||||
End Function
|
||||
Public Class FontSetting
|
||||
Public Property Title As String
|
||||
Public Property Value As Integer
|
||||
|
||||
Reference in New Issue
Block a user