Has an Event been Fired?

  • Thread starter Thread starter news.microsoft.com
  • Start date Start date
N

news.microsoft.com

When a control is clicked multiple events are fired in order. For example,
clicking on a combobox dropdown button fires the Enter -> Got Focus -> Click
event. In the "Enter" event handler is it possible to find out if the
"Click" event is going to happen?

I am trying to autoexpand the ComboBox dropdown when the control is entered.

Private Sub cboComboBox_Enter(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cboComboBox.Enter
cboComboBox.DroppedDown = True
End Sub

But if the ComboBox dropdown button is clicked the Enter event expands the
list and the Click event then closes it. In my Enter event handler I was to
find out if the Click event is going to happen to decide if I should expand
the combo list

Example:

Private Sub cboComboBox_Enter(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cboComboBox.Enter
If Not ControlHasBeenClick = True Then
cboComboBox.DroppedDown = True
End If
End Sub

Thanks,

Hex
 
Hi,
No, you can't know of the *Click* event will come after *Enter*. But if you
set the DroppedDown property to true in the *Click* event as well this will
do the trick for you.

HTH
B\rgds
100
 
Back
Top