add f2 to open, backspace to clear

This commit is contained in:
Jonathan Jenne
2023-12-18 13:55:41 +01:00
parent 04396d3fad
commit f8a2f73bb9
2 changed files with 56 additions and 17 deletions

View File

@@ -15,6 +15,8 @@ Imports DevExpress.XtraGrid.Columns
Public Class LookupControl3
Inherits GridLookUpEdit
Private Const TAG_BUTTON_LOOKUP_FORM = "openLookupForm"
<DesignerSerializationVisibility(DesignerSerializationVisibility.Content)>
Public Shadows ReadOnly Property Properties As RepositoryItemLookupControl3
Get
@@ -36,6 +38,19 @@ Public Class LookupControl3
e.Cancel = True
End Sub
Private Sub LookupControl3_KeyUp(sender As Object, e As KeyEventArgs) Handles Me.KeyUp
If e.KeyCode = Keys.F2 Then
Dim oLookup As LookupControl3 = sender
Dim oButton As EditorButton = oLookup.Properties.Buttons.
Where(Function(b) b.Tag = TAG_BUTTON_LOOKUP_FORM).
SingleOrDefault()
If oButton IsNot Nothing Then
oLookup.PerformClick(oButton)
End If
End If
End Sub
Shadows WithEvents fProperties As RepositoryItemGridLookUpEdit
Friend WithEvents fPropertiesView As DevExpress.XtraGrid.Views.Grid.GridView
End Class