Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make a textbox Read Only using Excel 2000 VBA

Status
Not open for further replies.

vestax22

Programmer
Jun 18, 2003
139
CA
Hi, I just want to know how to make a textbox read only without setting the enabled property to false.

I use a method called setfocus on these textboxes which requires them to be enabled.

Any help would be appreciated.

 
The textox should have a Locked property which is initially set to false, by changing this to true either in the properties window, or at runtime it should prevent any editing of the TexBox contents.

Leigh Moore
LJM Analysis Ltd
 
If you don't want the user to be able to select the text either (i.e. to copy it elsewhere) then you should use a Label and format to look like a TextBox (i.e. BackColor = White or Grey & SpecialEffect = Sunken).

If you only want to prohibit the user from inserting or typing text into the TextBox, then follow leighMoore's suggestion, it is easier and invloves less formatting.

Have Fun!



If you can't be "The Best", be the best at what you can!!!

Never say Never!!!
Nothing is impossible!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top