Link to home
Start Free TrialLog in
Avatar of davidb
davidbFlag for United States of America

asked on

Mouse down event for Combo box?

When you mouse click on the text part of a Combo box the GotFocus event fires first. Is there any way to sense the mouse down or click first?
Avatar of rhastie
rhastie

There is no easy way to do so, but you could call the event prcedure associated with the click or mousedown event from within the GotFocus event.

Avatar of davidb

ASKER

I want to scroll the page when someone tabs to the combo box but not when they click on the text box part of the combo box (not talking about the drop down part) Can't find a way to sence the differance between tabing to the combo box and clicking on the text box part of it.
I have something unclear about your question:
Whether you want to deal  the following two things with diffrent actions:
1.the combo box's GetFocus event
2.when the user click the text part of a combo box
Avatar of davidb

ASKER

Trying to sence whether a user has clicked to get to the text part of a combo box or instead used the tab key to get to the combo box.
ASKER CERTIFIED SOLUTION
Avatar of i007086
i007086

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
There is some modification of my proposed answer:
Replace the step 3 in the answer with the following:
3.Place a combobox on the form, set its style to 1(simple);
  set its text property to blank;

Replace the step 8 in the answer with the following:
8.Put the following code in the Text2_click procedure:
      ClickIt=True
      Text2.visible=False
      Combo1.SetFocus

Replace the step 9 in the answer with the following:
9.Put the following code in the combo1_GotFocus procedure:
      if ClickIt=True Then
           ClickIt=False
           Msgbox "click the text"
           Exit sub
      end if
      msgbox "Tab to me"

Add step 11 to the answer:
11.Put the following code in the Combo1_Lostfocus procedure:
      Text2.visible=True