Files
docs-desktop/dotnet-desktop-guide/framework/winforms/controls/how-to-create-a-read-only-text-box-windows-forms.md
Andy De George c0ba284473 Initial winforms content migrated (#18)
* 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
2020-09-01 16:26:21 -07:00

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
TextBox control [Windows Forms], read-only
read-only text boxes
text boxes [Windows Forms], read-only
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

  1. Set the xref:System.Windows.Forms.TextBox control's xref:System.Windows.Forms.TextBoxBase.ReadOnly%2A property to true. With the property set to true, 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