Bring to Front

R2D2

Registered User.
Local time
Today, 19:57
Joined
Jul 11, 2002
Messages
62
Is there anyway to bring a control to the front (exactly like what Format->Bring to Front does) in VBA? I have a combo box that is directly below a label, close enough that the top pixel of the combo box exactly overlaps with the bottom pixel of the label. Sometimes while I'm running my form, the label will be drawn after the combo box and prevent the top of the combo box from showing. It's not a functional problem, but it just makes my combo box look a bit funny. Regardless of how many times I bring the combo box to the front in design mode, it will always wind up behind the label at some point during execution. I need a way to programmatically Bring the box to the front during execution.

I've tried SetFocus, and that works most of the time. The problem is that sometimes my combo box is not enabled, and set focus won't work then.

And yes, I know I could move the combo box down, but my form is quite cramped for space, and I really like how the lay out looks...

Thanks!
 
If you wouldnt mind a slight change, you could make the combo into a listbox, then size it down to a single line. Say the list conatains names, and you have 250 in the list. You want to find John Doe, you could type J and it would jump straight to the Js in the list. I would sconserve space and allow you to eliminate the overlap without radically changing the forms design.
 

Users who are viewing this thread

Back
Top Bottom