* Merge winforms framework content to working branch (#14) * Breadcrumb / TOC / Move net5 to net folder (#15) * change path from net5 to net * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Add .net 5 winforms placeholder article (#16) * added some metadata and adjusted net5 placeholder * corrections * corrections * corrections * Test1 * Swapping landing page vs concept * fix links * Fix links * Fix desc
2.1 KiB
title, description, ms.date, helpviewer_keywords, ms.assetid
| title | description | ms.date | helpviewer_keywords | ms.assetid | |||
|---|---|---|---|---|---|---|---|
| How to: Create a Read-Only Text Box | Learn about transforming an editable Windows Forms text box into a read-only Windows Forms text box. | 03/30/2017 |
|
60baa9ab-fa57-44ad-bb7c-61b05aa64296 |
How to: Create a Read-Only Text Box (Windows Forms)
You can transform an editable Windows Forms text box into a read-only control. For example, the text box may display a value that is usually edited but may not be currently, due to the state of the application.
To create a read-only text box
-
Set the xref:System.Windows.Forms.TextBox control's xref:System.Windows.Forms.TextBoxBase.ReadOnly%2A property to
true. With the property set totrue, users can still scroll and highlight text in a text box without allowing changes. A Copy command is functional in a text box, but Cut and Paste commands are not.Note
The xref:System.Windows.Forms.TextBoxBase.ReadOnly%2A property only affects user interaction at run time. You can still change text box contents programmatically at run time by changing the xref:System.Windows.Forms.TextBox.Text%2A property of the text box.
See also
- xref:System.Windows.Forms.TextBox
- TextBox Control Overview
- How to: Control the Insertion Point in a Windows Forms TextBox Control
- How to: Create a Password Text Box with the Windows Forms TextBox Control
- How to: Put Quotation Marks in a String
- How to: Select Text in the Windows Forms TextBox Control
- How to: View Multiple Lines in the Windows Forms TextBox Control
- TextBox Control