You can transform an editable Win Forms text box into a read-only control. For example, if the text box is bound to a primary key field in a database, you may want to prevent users from editing the field.
To create a read-only text box
Note The ReadOnly property only affects user interaction at run time. You can still change text box contents programmatically at run time by changing the Text property of the text box.
Controlling the Insertion Point in a TextBox Control | Creating a Password Text Box with the TextBox Control | Putting Quotation Marks in a String Programmatically | Selecting Text Programmatically in the TextBox Control | Viewing Multiple Lines in the TextBox Control| TextBox Control