Mousemove event and auto combo-box dropdown

  • Thread starter Thread starter mscertified
  • Start date Start date
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.
 
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.
 
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.
 
Back
Top