>> Protected Overrides Function ProcessCmdKey(ByRef Msg As Message, ByVal KeyData As Keys) As Boolean >> '************************************************************************ >> ' Procedure/Function: ProcessCmdKey() >> ' Author: Ben Santiago >> ' Created On: 08/14/2006 >> ' Description: >> ' Capture and process "special" keys. >> '************************************************************************ >> >> '*************************************** >> ' Define Constants >> '*************************************** >> Const WM_KEYDOWN As Integer = &H100 >> Const WM_SYSKEYDOWN As Integer = &H104 >> >> '*************************************** >> ' Initialize Variables >> '*************************************** >> Dim intAnswer As MsgBoxResult >> >> '*************************************** >> ' Process Key Pressed >> '*************************************** >> If ((Msg.Msg = WM_KEYDOWN) Or (Msg.Msg = WM_SYSKEYDOWN)) Then >> Select Case (KeyData) >> Case Keys.Delete >> '*************************************** >> ' Query User To Confirm Row Delete >> '*************************************** >> If Me.IsSelected(Me.CurrentRowIndex) Then >> intAnswer = MessageBox.Show("Are you sure you want to delete the selected record?", "Confirm Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) >> If intAnswer = MsgBoxResult.Yes Then >> '*************************************** >> ' Send Keys To Base Function For Processing >> '*************************************** >> Return MyBase.ProcessCmdKey(Msg, KeyData) >> End If >> End If >> End Select >> End If >> End Function >>>>