Home All Groups Group Topic Archive Search About

WM_KeyUp message on ComboBoxes

Author
31 Jul 2006 1:29 PM
Keith
The WM_KeyUp message doesn't seem to be firing for a combobox when the
DropDownType is set to DropDown.  Can anyone shed light as to why, and how to
get around it?  I'm trying to fix the NoKeyUpCombo inherited combobox (code
below) to work with true ComboBoxes (where you can type into the box OR
select from the list), but every DataGridComboBoxColumn example out there
seems to only support the DropDownType of DropDownList.

Here's the control for those that haven't seen it (the reason for cancelling
the KeyUp is to prevent double-tabbing - the tab KeyDown and KeyUp events
both cause a cell change for some reason):

Public Class NoKeyUpCombo
        Inherits System.Windows.Forms.ComboBox

        Private Const WM_KEYUP As Integer = &H101
        Private Const WM_MOUSEWHEEL As Integer = &H20A

        Protected Overrides Sub WndProc(ByRef theMessage As
System.Windows.Forms.Message)
            If theMessage.Msg = WM_KEYUP Then
                Return
            Else
                MyBase.WndProc(theMessage)
            End If
        End Sub

    End Class

AddThis Social Bookmark Button