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

Re: Has an Event been Fired? by 100

100
Thu Jan 22 11:57:11 CST 2004

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


"news.microsoft.com" <hadezimal@hotmail.com> wrote in message
news:%23%23mIozP4DHA.2188@TK2MSFTNGP10.phx.gbl...
> 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
>
>