Userform - Formating Text in a Label

  • Thread starter Thread starter Guest
  • Start date Start date
What can I do to make my text look centered in the label? Mine looks like it
is top centered?
 
This came up recently in subject "CommandBar Caption Orientation" and Dave
Peterson suggested suggested:

"Separate each character by ctrl-enter (to force a new line)"

- which at the time I thought was a neat idea!

If your text has only one vertical line that should work for the label
caption.

Regards,
Peter T
 
Hi Teb2,
What can I do to make my text look centered in the label? Mine looks like it
is top centered?

Use two labels, one for the background/border, one (transparent) for the text
and center them with code:

lblFront.Top = lblBack.Top + (lblBack.Height - lblFront.Height) \ 2

and the same for the left/width

Regards

Stephen Bullen
Microsoft MVP - Excel

Professional Excel Development
The most advanced Excel VBA book available
www.oaltd.co.uk/ProExcelDev
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top