TextBox.IsReadOnly Property

Definition

Gets or sets the value that determines if the user can change the text in the text box.

public:
 property bool IsReadOnly { bool get(); void set(bool value); };
bool IsReadOnly();

void IsReadOnly(bool value);
public bool IsReadOnly { get; set; }
var boolean = textBox.isReadOnly;
textBox.isReadOnly = boolean;
Public Property IsReadOnly As Boolean
<TextBox IsReadOnly="bool"/>

Property Value

Boolean

bool

true if the text box is read-only; otherwise, false. The default is false.

Remarks

The default control template for TextBox has a visual state that tracks whether the TextBox is read-only. If the TextBox is read-only, it appears in a gray color in most themes. This also tracks if Control.IsEnabled is false.

Applies to

See also