Class TextBox
Represents a control that can be used to display single-format, multi-line
text.
Inheritance
System.Object
TextBox
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: OpenSilver.dll
Syntax
public class TextBox : Control
Examples
TextBoxName.Text = "Some text";
Constructors
|
Improve this Doc
View Source
TextBox()
Declaration
Fields
|
Improve this Doc
View Source
AcceptsReturnProperty
Identifies the AcceptsReturn dependency property.
Declaration
public static readonly DependencyProperty AcceptsReturnProperty
Field Value
|
Improve this Doc
View Source
AcceptsTabProperty
Identifies the AcceptsReturn dependency property.
Declaration
public static readonly DependencyProperty AcceptsTabProperty
Field Value
|
Improve this Doc
View Source
CaretBrushProperty
Identify the CaretBrush dependency property
Declaration
public static readonly DependencyProperty CaretBrushProperty
Field Value
|
Improve this Doc
View Source
HorizontalScrollBarVisibilityProperty
Identifies the HorizontalScrollBarVisibility dependency property.
Declaration
public static readonly DependencyProperty HorizontalScrollBarVisibilityProperty
Field Value
|
Improve this Doc
View Source
IsReadOnlyProperty
Declaration
public static readonly DependencyProperty IsReadOnlyProperty
Field Value
|
Improve this Doc
View Source
MaxLengthProperty
Identifies the MaxLength dependency property.
Declaration
public static readonly DependencyProperty MaxLengthProperty
Field Value
|
Improve this Doc
View Source
PlaceholderTextProperty
Identifies the PlaceholderText dependency property.
Declaration
public static readonly DependencyProperty PlaceholderTextProperty
Field Value
|
Improve this Doc
View Source
SelectionBackgroundProperty
Declaration
[NotImplemented]
public static readonly DependencyProperty SelectionBackgroundProperty
Field Value
|
Improve this Doc
View Source
SelectionForegroundProperty
Declaration
[NotImplemented]
public static readonly DependencyProperty SelectionForegroundProperty
Field Value
|
Improve this Doc
View Source
TextAlignmentProperty
Identifies the TextAlignment dependency property.
Declaration
public static readonly DependencyProperty TextAlignmentProperty
Field Value
|
Improve this Doc
View Source
TextDecorationsProperty
Identifies the TextDecorations dependency property.
Declaration
public static readonly DependencyProperty TextDecorationsProperty
Field Value
|
Improve this Doc
View Source
TextProperty
Identifies the Text dependency property.
Declaration
public static readonly DependencyProperty TextProperty
Field Value
|
Improve this Doc
View Source
TextWrappingProperty
Identifies the TextWrapping dependency property.
Declaration
public static readonly DependencyProperty TextWrappingProperty
Field Value
|
Improve this Doc
View Source
VerticalScrollBarVisibilityProperty
Identifies the VerticalScrollBarVisibility dependency property.
Declaration
public static readonly DependencyProperty VerticalScrollBarVisibilityProperty
Field Value
Properties
|
Improve this Doc
View Source
AcceptsReturn
Gets or sets the value that determines whether the text box allows and displays
the newline or return characters.
Declaration
public bool AcceptsReturn { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
AcceptsTab
Gets or sets the value that determines whether pressing tab while the TextBox has the focus will add a tabulation in the text or set the focus to the next element.
True to add a tabulation, false to set the focus to the next element.
Declaration
public bool AcceptsTab { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
CaretBrush
Gets or sets the brush that is used to render the vertical bar that indicates
the insertion point.
Declaration
public Brush CaretBrush { get; set; }
Property Value
|
Improve this Doc
View Source
HorizontalScrollBarVisibility
Gets or sets a value that indicates whether a horizontal ScrollBar should
be displayed.
Returns a ScrollBarVisibility value that indicates whether a horizontal ScrollBar
should be displayed. The default value is Hidden.
Declaration
public ScrollBarVisibility HorizontalScrollBarVisibility { get; set; }
Property Value
|
Improve this Doc
View Source
IsReadOnly
Declaration
public bool IsReadOnly { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
LineHeight
Declaration
[NotImplemented]
public double LineHeight { get; set; }
Property Value
Type |
Description |
System.Double |
|
|
Improve this Doc
View Source
MaxLength
Gets or sets the value that determines the maximum number of characters allowed
for user input.
Declaration
public int MaxLength { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
PlaceholderText
Gets or sets the text that is displayed in the control until the value is changed by a user action or some other operation.
Declaration
public string PlaceholderText { get; set; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
SelectedText
Declaration
public string SelectedText { get; set; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
SelectionBackground
Declaration
[NotImplemented]
public Brush SelectionBackground { get; set; }
Property Value
|
Improve this Doc
View Source
SelectionForeground
Declaration
[NotImplemented]
public Brush SelectionForeground { get; set; }
Property Value
|
Improve this Doc
View Source
SelectionLength
Declaration
public int SelectionLength { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
SelectionStart
Declaration
public int SelectionStart { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Text
Gets or sets the text displayed in the TextBox.
Declaration
public string Text { get; set; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
TextAlignment
Gets or sets how the text should be aligned in the text box.
Declaration
public TextAlignment TextAlignment { get; set; }
Property Value
|
Improve this Doc
View Source
TextDecorations
Gets or sets the text decorations (underline, strikethrough...).
Declaration
public TextDecorationCollection TextDecorations { get; set; }
Property Value
|
Improve this Doc
View Source
TextWrapping
Gets or sets how the TextBow wraps text.
Declaration
public TextWrapping TextWrapping { get; set; }
Property Value
|
Improve this Doc
View Source
VerticalScrollBarVisibility
Gets or sets a value that indicates whether a vertical ScrollBar should be displayed.
Declaration
public ScrollBarVisibility VerticalScrollBarVisibility { get; set; }
Property Value
Methods
|
Improve this Doc
View Source
MeasureOverride(Size)
Declaration
protected override Size MeasureOverride(Size availableSize)
Parameters
Type |
Name |
Description |
Size |
availableSize |
|
Returns
Overrides
|
Improve this Doc
View Source
OnApplyTemplate()
Builds the visual tree for the
TextBox control when a new
template is applied.
Declaration
public override void OnApplyTemplate()
Overrides
|
Improve this Doc
View Source
OnKeyDown(KeyEventArgs)
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Overrides
|
Improve this Doc
View Source
OnMouseLeftButtonDown(MouseButtonEventArgs)
Declaration
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
Overrides
|
Improve this Doc
View Source
OnMouseLeftButtonUp(MouseButtonEventArgs)
Declaration
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Parameters
Overrides
|
Improve this Doc
View Source
OnTextChanged(TextChangedEventArgs)
Raises the TextChanged event
Declaration
protected virtual void OnTextChanged(TextChangedEventArgs eventArgs)
Parameters
|
Improve this Doc
View Source
OnTextInput(TextCompositionEventArgs)
Declaration
protected override void OnTextInput(TextCompositionEventArgs e)
Parameters
Overrides
|
Improve this Doc
View Source
Select(Int32, Int32)
Declaration
public void Select(int start, int length)
Parameters
Type |
Name |
Description |
System.Int32 |
start |
|
System.Int32 |
length |
|
|
Improve this Doc
View Source
SelectAll()
Selects all text in the text box.
Declaration
Events
|
Improve this Doc
View Source
SelectionChanged
Declaration
[NotImplemented]
public event RoutedEventHandler SelectionChanged
Event Type
|
Improve this Doc
View Source
TextChanged
Occurs when the text is changed.
Declaration
public event TextChangedEventHandler TextChanged
Event Type
Extension Methods