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 TextBox control's ReadOnly 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.
See also
- 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
Dolgozzon együtt velünk a GitHubon
A tartalom forrása a GitHubon található, ahol létrehozhat és áttekinthet problémákat és lekéréses kérelmeket is. További információért tekintse meg a közreműködői útmutatónkat.
.NET Desktop feedback
Visszajelzés
https://aka.ms/ContentUserFeedback.
Hamarosan elérhető: 2024-ben fokozatosan kivezetjük a GitHub-problémákat a tartalom visszajelzési mechanizmusaként, és lecseréljük egy új visszajelzési rendszerre. További információ:Visszajelzés küldése és megtekintése a következőhöz: