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/273025-re-making-textbox-look-feel-like-label-userform.html)

Harald Staff[_4_]

Making a TextBox look and feel like a Label in a userform
 
I see, yes it makes sense.

The only thing you have to do is put the textbox inside a frame control. Delete the
frame's caption and border if you want it "invisible" for layout reasons. Then you can
just toggle it like

Frame1.Enabled = Not Frame1.Enabled

and leave the textbox as is, no alterations needed.

--
HTH. Best wishes Harald
Excel MVP

Followup to newsgroup only please.

"Mike NG" wrote in message ...
On Wed, 30 Jul 2003 at 00:15:11, Harald Staff (Harald Staff
) wrote:
Why spend time learning a cat to bark when you can have a dog ? What do you want the
textbox to do that a label can't ?

In one mode to be a textbox, but in the other for it to behave like a
label, i.e. display only and not landable. My form has several fields
and having two userforms would be wasteful, especially since most of the
code does the same thing in the two modes.





Mike NG

Making a TextBox look and feel like a Label in a userform
 
On Wed, 30 Jul 2003 at 08:33:28, Harald Staff (Harald Staff
) wrote:
The only thing you have to do is put the textbox inside a frame control. Delete the
frame's caption and border if you want it "invisible" for layout reasons.

Many thanks.

I was wondering if, using your original analogy, I could have taught a
dog to be a cat, but that wouldn't have worked either
--
Mike

Mike NG

Making a TextBox look and feel like a Label in a userform
 
On Wed, 30 Jul 2003 at 10:02:21, Harald Staff (Harald Staff
) wrote:
I was wondering if, using your original analogy, I could have taught a
dog to be a cat, but that wouldn't have worked either


Make a label accept keyboard and mouse input in a reasonable intuitive way ? Very fun challenge, probably close to impossible and
not worth the time.

Yes impossible I think - it was something just mulling through my head
after I'd switched the computer off
--
Mike


All times are GMT +1. The time now is 11:09 PM.

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