Add a lot of functions to Base

This commit is contained in:
Jonathan Jenne
2023-06-16 09:16:49 +02:00
parent 00cff028c9
commit b1114545a7
8 changed files with 359 additions and 0 deletions

View File

@@ -45,4 +45,45 @@ Public Class ScreenEx
RestoreFormState(pForm, oFormState)
End Sub
''' <summary>
''' Checks if a point is Visible on any screen
''' </summary>
Public Shared Function IsVisibleOnAnyScreen(Location As Point) As Boolean
Try
Dim oRect As New Rectangle(Location, New Size(0, 0))
For Each oScreen In Screen.AllScreens
If oScreen.WorkingArea.IntersectsWith(oRect) Then
Return True
End If
Next
Return False
Catch ex As Exception
Return False
End Try
End Function
''' <summary>
''' Checks if Size is not negative
''' </summary>
Public Shared Function SizeIsVisible(Size As Size) As Boolean
If Size.Width >= 0 And Size.Height >= 0 Then
Return True
End If
Return False
End Function
''' <summary>
''' Checks if Location is not negative
''' </summary>
Public Shared Function LocationIsVisible(Location As Point) As Boolean
If Location.X >= 0 And Location.Y >= 0 Then
Return True
End If
Return False
End Function
End Class