LookupGrid: Fix Form text, fix form sticking out of monitor when there is no space
This commit is contained in:
@@ -257,13 +257,26 @@ Public Class RepositoryItemLookupControl3
|
||||
.PreventDuplicates = PreventDuplicates,
|
||||
.DataSource = DataSource,
|
||||
.SelectedValues = SelectedValues,
|
||||
.StartPosition = FormStartPosition.Manual,
|
||||
.Location = OwnerEdit.PointToScreen(New Point(OwnerEdit.Width, 0))
|
||||
.StartPosition = FormStartPosition.Manual
|
||||
}
|
||||
Dim oScreen = Screen.FromControl(oForm)
|
||||
oForm.Location = GetFormLocation(oForm.Height, oForm.Width, oScreen)
|
||||
|
||||
Return oForm
|
||||
End Function
|
||||
|
||||
Private Function GetFormLocation(pFormHeight As Integer, pFormWidth As Integer, pScreen As Screen) As Point
|
||||
' This is the location on the same height like the Lookup Control
|
||||
Dim oDefaultLocation = OwnerEdit.PointToScreen(New Point(OwnerEdit.Width, 0))
|
||||
Dim oScreenheight = pScreen.Bounds.Height
|
||||
|
||||
If oScreenheight < (oDefaultLocation.Y + pFormHeight) Then
|
||||
Return OwnerEdit.PointToScreen(New Point(OwnerEdit.Width, -pFormHeight + OwnerEdit.Height))
|
||||
End If
|
||||
|
||||
Return oDefaultLocation
|
||||
End Function
|
||||
|
||||
Protected Overrides Sub RaiseButtonClick(e As ButtonPressedEventArgs)
|
||||
MyBase.RaiseButtonClick(e)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user