Re: Mouse roller changes combobox SelectedItem not visible, wich fires SelectedIndexChanged event



If you are looking at intercepting MouseRoll and nulling it out, here is some code I was typing today...


Public Class SpecialComboBox
Inherits ComboBox


Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)

Const WM_COMMAND As Int32 = 273

Select Case True
Case m.Msg = WM_COMMAND And m.WParam = New System.IntPtr(66536) 'intercepts WM_COMMAND (which prevent DropDownBox from closing after WM_LBUTTONDOWN)


'2 - (NEW) nulls MouseWheel on not .DropDown
If Not Me.DroppedDown Then
Exit Sub
End If

End Select


MyBase.WndProc(m)


End Sub

End class

.