ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Making a TextBox look and feel like a Label in a userform (https://www.excelbanter.com/excel-programming/273011-re-making-textbox-look-feel-like-label-userform.html)

ijb

Making a TextBox look and feel like a Label in a userform
 
Mike, I can see there are certain times when you cannot make do with making
it a label (wanting to re-use the same form without adding a lot of code at
the start to change the type for example). So cheat a little - Place the
textbox in a frame, remove the frame border, and set the FRAMES enabled
property to false.

HTH

rgrds ijb

--
Remove nospam from my e-mail address to talk direct

Not MCSD just experienced

"Mike NG" wrote in message
...
I have a UserForm which looks identical - except I have a read only mode
and an update mode

I've tried changing the following properties of the TextBox, but I can't
achieve the effect where it looks/behaves like a Label, for example

Set Enabled to true - not too bad in that you can't click or tab onto
it, but it's a dimmed out version

Set Locked to true - not dimmed like setting Enable to true, but it's
still possible to tab into the field

Set TabStop to FALSE, is fine in that you can't reach it with the TAB
key, but you can still click into it


Setting Locked to True and TabStop to False is a compromise I'm happy to
live with, but can I go the whole hog? I'm using XL2000 SR-1a
--
Mike





All times are GMT +1. The time now is 08:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com