Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

TextBox.IsReadOnly Property

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

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


Feedback

Was this page helpful?