diff --git a/Controls.LookupGrid/LookupControl3.vb b/Controls.LookupGrid/LookupControl3.vb index 14e052e2..86543c94 100644 --- a/Controls.LookupGrid/LookupControl3.vb +++ b/Controls.LookupGrid/LookupControl3.vb @@ -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) diff --git a/Controls.LookupGrid/Resources/Strings.Designer.vb b/Controls.LookupGrid/Resources/Strings.Designer.vb index 8086d3d6..836aa51a 100644 --- a/Controls.LookupGrid/Resources/Strings.Designer.vb +++ b/Controls.LookupGrid/Resources/Strings.Designer.vb @@ -94,9 +94,9 @@ Namespace My.Resources ''' ''' Sucht eine lokalisierte Zeichenfolge, die Bitte wählen Sie einen oder mehrere Werte aus: ähnelt. ''' - Friend Shared ReadOnly Property PopupForm_TextMultiLine() As String + Friend Shared ReadOnly Property PopupForm_TextMultiselect() As String Get - Return ResourceManager.GetString("PopupForm_TextMultiLine", resourceCulture) + Return ResourceManager.GetString("PopupForm_TextMultiselect", resourceCulture) End Get End Property End Class diff --git a/Controls.LookupGrid/Resources/Strings.en.resx b/Controls.LookupGrid/Resources/Strings.en.resx index 5f7dada9..4de38075 100644 --- a/Controls.LookupGrid/Resources/Strings.en.resx +++ b/Controls.LookupGrid/Resources/Strings.en.resx @@ -126,7 +126,7 @@ Please choose a value: - + Please choose one or more values: \ No newline at end of file diff --git a/Controls.LookupGrid/Resources/Strings.resx b/Controls.LookupGrid/Resources/Strings.resx index f7c2d066..6915b57d 100644 --- a/Controls.LookupGrid/Resources/Strings.resx +++ b/Controls.LookupGrid/Resources/Strings.resx @@ -126,7 +126,7 @@ Bitte wählen Sie einen Wert aus: - + Bitte wählen Sie einen oder mehrere Werte aus: \ No newline at end of file diff --git a/Controls.LookupGrid/frmLookupGrid.vb b/Controls.LookupGrid/frmLookupGrid.vb index 15722d11..e0c43932 100644 --- a/Controls.LookupGrid/frmLookupGrid.vb +++ b/Controls.LookupGrid/frmLookupGrid.vb @@ -65,10 +65,10 @@ Public Class frmLookupGrid oCheckboxColumn.OptionsColumn.AllowFocus = False - Text = _R.GetString("PopupForm_Text") + Text = _R.GetString("PopupForm_TextMultiselect") _DataColumn = 1 Else - Text = _R.GetString("PopupForm_TextMultiLine") + Text = _R.GetString("PopupForm_Text") _DataColumn = 0 End If