Textbox – Hide Textbox Caret and Prevent Textbox Selection

Hide Textbox Caret and Prevent Textbox Selection

Here is how to make a textbox look and act like label. There are times you would rather use a textbox than a label simply because there is a bit of greater control of the appearance with a textbox versus a label.

  1. Set the Textbox Locked property to True. (prevents changing whats in textbox – setting the control Enable=False makes it so you can’t control the textbox text color as Enabled=False defaults to grey color).
  2. Set Textbox borderstyle = None (makes the textbox not look like a textbox).
  3. Add the following code to the Textbox (when user tries to click on textbox or set focus on it any other way the focus goes to SomethingElse – a command button works fine)