add f2 to open, backspace to clear
This commit is contained in:
@@ -22,6 +22,8 @@ Public Class frmLookupGrid
|
||||
Private _Grid As GridControl
|
||||
Private ReadOnly _R As Resources.ResourceManager = My.Resources.Strings.ResourceManager
|
||||
|
||||
Private colCheckbox As GridColumn
|
||||
|
||||
#Region "Form Events"
|
||||
Private Sub frmLookupGrid_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
_View = viewLookup
|
||||
@@ -57,12 +59,12 @@ Public Class frmLookupGrid
|
||||
|
||||
If MultiSelect Then
|
||||
' Selected Spalte anpassen
|
||||
Dim oCheckboxColumn = _View.Columns.Item(0)
|
||||
colCheckbox = _View.Columns.Item(0)
|
||||
'oCheckboxColumn.Visible = False
|
||||
oCheckboxColumn.Caption = " "
|
||||
oCheckboxColumn.MaxWidth = 30
|
||||
oCheckboxColumn.MinWidth = 30
|
||||
oCheckboxColumn.OptionsColumn.AllowFocus = False
|
||||
colCheckbox.Caption = " "
|
||||
colCheckbox.MaxWidth = 30
|
||||
colCheckbox.MinWidth = 30
|
||||
colCheckbox.OptionsColumn.AllowFocus = False
|
||||
|
||||
|
||||
Text = _R.GetString("PopupForm_TextMultiselect")
|
||||
@@ -107,14 +109,24 @@ Public Class frmLookupGrid
|
||||
#End Region
|
||||
#Region "Button Events"
|
||||
Private Sub btnOK_Click(sender As Object, e As EventArgs) Handles btnOK.Click
|
||||
SaveSelectedValues()
|
||||
SaveAndClose()
|
||||
End Sub
|
||||
|
||||
Private Sub btnClear_Click(sender As Object, e As EventArgs) Handles btnClear.Click
|
||||
ClearAndClose()
|
||||
End Sub
|
||||
|
||||
Private Sub ClearAndClose()
|
||||
SelectedValues = New List(Of String)
|
||||
|
||||
DialogResult = DialogResult.OK
|
||||
Close()
|
||||
End Sub
|
||||
|
||||
Private Sub btnClear_Click(sender As Object, e As EventArgs) Handles btnClear.Click
|
||||
SelectedValues = New List(Of String)
|
||||
Private Sub SaveAndClose()
|
||||
' Make sure the currently focused row's state is saved
|
||||
viewLookup.PostEditor()
|
||||
SaveSelectedValues()
|
||||
|
||||
DialogResult = DialogResult.OK
|
||||
Close()
|
||||
@@ -130,17 +142,29 @@ Public Class frmLookupGrid
|
||||
End Sub
|
||||
|
||||
Private Sub HandleCustomKeys(e As KeyEventArgs)
|
||||
If e.KeyCode = Keys.Escape Then
|
||||
Close()
|
||||
Select Case e.KeyCode
|
||||
Case Keys.Escape
|
||||
Close()
|
||||
|
||||
ElseIf e.KeyCode = Keys.F2 Then
|
||||
' Make sure the currently focused row's state is saved
|
||||
viewLookup.PostEditor()
|
||||
SaveSelectedValues()
|
||||
Case Keys.F2
|
||||
SaveAndClose()
|
||||
|
||||
DialogResult = DialogResult.OK
|
||||
Close()
|
||||
End If
|
||||
Case Keys.Back
|
||||
ClearAndClose()
|
||||
|
||||
Case Keys.Space
|
||||
If MultiSelect Then
|
||||
Dim oHandle = viewLookup.FocusedRowHandle
|
||||
If oHandle >= 0 Then
|
||||
Dim oIsChecked = viewLookup.GetRowCellValue(oHandle, colCheckbox)
|
||||
If oIsChecked Then
|
||||
viewLookup.SetRowCellValue(oHandle, colCheckbox, False)
|
||||
Else
|
||||
viewLookup.SetRowCellValue(oHandle, colCheckbox, True)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Select
|
||||
End Sub
|
||||
#End Region
|
||||
#Region "View Events"
|
||||
|
||||
Reference in New Issue
Block a user