Placing A Label Over A Userform Control

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,564
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have a label (label8) that I am trying to position at a certain point of my userform.

Code:
        With .Label8
            .Top = 36
            .Left = 92
        End With

The issue I am having, is this move puts the label behind a locked listbox control. This is the intended location, but I'd like to put the label on top of this control.

Can it be done?
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Thanks MAIT ...

this is my code ...

Code:
        With .Label9
            .Top = 216
            .Left = 90
            .ZOrder 0
        End With

With the exception of not being in the initialization code of the userform, I can't clearly see where my codes differs to give a different result.
 
Last edited:
Upvote 0
I previously tried doing this manually and was never able to get a label to sit over top of a listbox and still be able to see the label
I tried the code provided and was never able to do it.

Are you saying you have been able to put a label on top of a listbox and still be able to see the listbox and the label assuming the label is smaller then the listbox. So part of the listbox should be visible?

Like I said when I tried the same using a label over top of a Textbox it would work
 
Upvote 0
Putting the Label in a Frame plus this worked for me to hide the listbox behind the Frame/Label combo.

Code:
With Frame1
    .Caption = vbNullString
    .SpecialEffect = fmSpecialEffectFlat
    .Top = ListBox1.Top
    .Left = ListBox1.Left
    .Height = ListBox1.Height
    .Width = ListBox1.Width
End With
With Label1
    .Top = 0: .Left = 0
    .Height = Frame1.Height
    .Width = Frame1.Width
End With

Frame1.ZOrder fmZOrderFront
 
Upvote 0

Forum statistics

Threads
1,217,037
Messages
6,134,131
Members
449,861
Latest member
DMJHohl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top