G
Graeme Richardson
Hi, I have the VB code from
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q889q.
How do I implement it?
I want the function PreProcessMessage to fire (code below) when I select a
record and type the delete key.
I have a DataGrid called grdTown that is populated with data from a
DataTable called mdtTown [also a DataAdapter (madpTown) and
BindingBaseManager (mbmbTown)].
Cheers, Graeme.
Public Class SubClass_DataGrid
Inherits DataGrid
Private Const WM_KEYDOWN = &H100
Public Overrides Function PreProcessMessage(ByRef msg As
System.Windows.Forms.Message) As Boolean
Dim keyCode As Keys = CType((msg.WParam.ToInt32 And Keys.KeyCode),
Keys)
If msg.Msg = WM_KEYDOWN And keyCode = Keys.Delete Then
If MessageBox.Show("Delete This Row?", "Confirm Delete",
MessageBoxButtons.YesNo) = DialogResult.No Then
Return True
End If
End If
Return MyBase.PreProcessMessage(msg)
End Function
End Class
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q889q.
How do I implement it?
I want the function PreProcessMessage to fire (code below) when I select a
record and type the delete key.
I have a DataGrid called grdTown that is populated with data from a
DataTable called mdtTown [also a DataAdapter (madpTown) and
BindingBaseManager (mbmbTown)].
Cheers, Graeme.
Public Class SubClass_DataGrid
Inherits DataGrid
Private Const WM_KEYDOWN = &H100
Public Overrides Function PreProcessMessage(ByRef msg As
System.Windows.Forms.Message) As Boolean
Dim keyCode As Keys = CType((msg.WParam.ToInt32 And Keys.KeyCode),
Keys)
If msg.Msg = WM_KEYDOWN And keyCode = Keys.Delete Then
If MessageBox.Show("Delete This Row?", "Confirm Delete",
MessageBoxButtons.YesNo) = DialogResult.No Then
Return True
End If
End If
Return MyBase.PreProcessMessage(msg)
End Function
End Class