C
Craig Bennett
I have some code to capture command keys. When I type
into a text box, the code runs once. When I type into a
combobox, the code runs twice. Can anyone explain this
behaviour to me? Here is the code which is in my form:
Protected Overrides Function ProcessCmdKey(ByRef msg
As _
System.Windows.Forms.Message, ByVal keyData As
System.Windows.Forms.Keys) As _
Boolean
Const WM_KEYDOWN As Integer = &H100
Dim blnHandled As Boolean = False
If msg.Msg = WM_KEYDOWN Then
Label1.Text = keyData.ToString & ":" &
Label1.Text
End If
blnHandled = MyBase.ProcessCmdKey(msg, keyData)
Return blnHandled
End Function
into a text box, the code runs once. When I type into a
combobox, the code runs twice. Can anyone explain this
behaviour to me? Here is the code which is in my form:
Protected Overrides Function ProcessCmdKey(ByRef msg
As _
System.Windows.Forms.Message, ByVal keyData As
System.Windows.Forms.Keys) As _
Boolean
Const WM_KEYDOWN As Integer = &H100
Dim blnHandled As Boolean = False
If msg.Msg = WM_KEYDOWN Then
Label1.Text = keyData.ToString & ":" &
Label1.Text
End If
blnHandled = MyBase.ProcessCmdKey(msg, keyData)
Return blnHandled
End Function