System.Windows.Forms.TextBoxBase.ReadOnly Property

Gets or sets a value indicating whether text in the text box is read-only.

Syntax

[System.ComponentModel.DefaultValue(false)]
[System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)]
public bool ReadOnly { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

When this property is set to true, the contents of the control cannot be changed by the user at runtime. With this property set to true, you can still set the value of the TextBoxBase.Text property in code. You can use this feature instead of disabling the control with the Control.Enabled property to allow the contents to be copied and ToolTips to be shown.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0
Since: .NET 2.0