Has an Event been Fired?

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
 
1

100

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top