combo box automatic dropdown position

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a combo box; when it has the focus, the dropdown appears. The problem
I have is that the dropdown appears in the wrong place. Sometimes it covers
the combo box itself. I would like the dropdown to appear directly underneath
the combo box. Thinking the form was corrupted, I started all over agian with
a new form and still experience the same problem. Can anyone help?
 
I've seen this occasionally in a form that is slow to open. The form opens,
the combo box drops down, and then the menus associated with the form are
displayed, the form moves up or down the screen to accommodate the menus,
and the dropped-down list is left where it was before the form moved.

Try taking the line of code that drops down the list out of the Enter or
GotFocus event procedure of the combo box, and moving it to the Timer event
procedure of the form. Add another line of code to set the TimerInterval to
0 ...

Me!NameOfCombo.DropDown
Me.TimerInterval = 0

Now, back in the Enter or GotFocus event procedure of the combo box, add a
line to start the Timer ...

Me.TimerInterval = 250

Hopefully, the 250 milliseconds (one quarter of a second) should give the
form time to move to its final position before the combo box drops down.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Back
Top