Mousemove event and auto combo-box dropdown

M

mscertified

My form has a series of combo boxes and labels in a strip across the top.
I use the mousemove event to drop down the associated combo box selections
as the cursor moves over the labels. The code first sets focus to the combo
box then drops it down. This all works great except when I move the mouse
away. The last dropped-down combo box stays dropped down. How can I get this
to 'go back up'.

Thanks.
 
D

Dale Fye

Personally, I wouldn't use the MouseMove to do this. I'd wait until my user
actually clicked in the combo box.

Put a rectangle with transparent back and borders styles around the combo
box and its caption. Use the MouseMove event of this rectangle to set the
focus to a another control. I use a textbox that has zero width and
transparent backstyle and borderstyle properties, (I call my txt_Dummy). I
normally make this control about 1/4" wide, but then set the width to zero in
the forms Open event.

Keep in mind, if the user keeps his cursor over the dropped down list, and
then move it off the list, outside of the rectangle, then the rectangles
MouseMove event will not fire.

--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.
 
W

Wes from Scottsdale

Use Private Sub Detail_MouseMove(Button...) to set the focus to a neutral
control. I use a txtbox with 0 height, 0 width and transparent borders in
the very top left corner of my form.

Detail_MouseMove fires anytime you move over the background of the form.
However, if your controls are so close together that the form is not hovered
on, this will not fire. For example if your labels "touch" your combobox and
you move between them, the detail event will not fire.

Hope this helps.
 

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