drag label in front of listbox (1 Viewer)

jesse

Registered User.
Local time
Today, 01:31
Joined
Jul 14, 2010
Messages
39
Hi,

I have a dragable label on one of my forms. However, when I drag it over a listbox it always disappears behind it. It makes no difference if I send the listbox to the back or bring the label to the front in design view.

Is there a way to get the label in front of the listbox through vba code?

(I'm using access 2010)

kind regards,
jesse
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 10:31
Joined
Jan 20, 2009
Messages
12,854
Why do you need this? You can make the listbox not visible if you want to hide it. I sometime use a rectangle with the BackStyle set to Normal to cover things.

Otherwise use a textbox control instead of the label. Set the BorderStyle to transparent, Locked to Yes and Enabled to No and it will behave exactly like a label.
 

jesse

Registered User.
Local time
Today, 01:31
Joined
Jul 14, 2010
Messages
39
I've tried to use a textbox instead of a label but it makes no difference. The textbox also disappears behind the listbox.

I also don't want to hide the listbox. I just want to be able to drag the label around the form without it disappearing behind other things.

So I want the label to be in front always. It seems like a simple thing but I don't know how to do it.
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 10:31
Joined
Jan 20, 2009
Messages
12,854
This is only an issue in design view since you are dragging it around.

You can bring controls to the front in code by:
Me!controlname.SetFocus
 

jesse

Registered User.
Local time
Today, 01:31
Joined
Jul 14, 2010
Messages
39
No, that doesn't work. I tried using a textox and .SetFocus but it still disappears behind a listbox when I drag it around the form.
 

Users who are viewing this thread

Top Bottom