M
Matthias Menningen via .NET 247
The Combobox control supplied by DOTNET configured as dropdown list
behaves in the following way: When the user clicks into the box it
immediately drops down.
Normally dropdown boxes should drop down only when the dropdown button of
the control is clicked. Most applications e. g. in Mocrosoft Office
do it this way. The ADO-bound Combo box sypplied with VB6 conformed with
this beaviour.
How can I change the behaviour of the standard DOTNET Combobox control?
I already tried the following (in the WndProc method):
o I supressed the WM_LBUTTONDOWN message. This suppresses, as expected,
all subsequent messages that fire the dropdown event and draw the
dropdown list etc.
However, it also prevents the box from receiving the focus.
o I tried to suppress all or selected messges that seem to by triggered by
WM_LBUTTONDOWN message using the following code (VB):
Static SuppressMsgs
...
Select Case m.Msg
Case WM_LBUTTONDOWN
...
SuppressMsgs = True
MyBase.WndProc(m)
SuppressMsgs = False
...
Case (other message)
If Not SuppressMsgs Then
MyBase.WndProc(m)
End If
...
This also does not have the desired effect. The box for the
dropdown list always shows up. Depending on which messages were
suppressed it is empty or has zero height.
behaves in the following way: When the user clicks into the box it
immediately drops down.
Normally dropdown boxes should drop down only when the dropdown button of
the control is clicked. Most applications e. g. in Mocrosoft Office
do it this way. The ADO-bound Combo box sypplied with VB6 conformed with
this beaviour.
How can I change the behaviour of the standard DOTNET Combobox control?
I already tried the following (in the WndProc method):
o I supressed the WM_LBUTTONDOWN message. This suppresses, as expected,
all subsequent messages that fire the dropdown event and draw the
dropdown list etc.
However, it also prevents the box from receiving the focus.
o I tried to suppress all or selected messges that seem to by triggered by
WM_LBUTTONDOWN message using the following code (VB):
Static SuppressMsgs
...
Select Case m.Msg
Case WM_LBUTTONDOWN
...
SuppressMsgs = True
MyBase.WndProc(m)
SuppressMsgs = False
...
Case (other message)
If Not SuppressMsgs Then
MyBase.WndProc(m)
End If
...
This also does not have the desired effect. The box for the
dropdown list always shows up. Depending on which messages were
suppressed it is empty or has zero height.