TextBox
Code Example: Creating a TextBox
// Initialize
var panel = new StackPanel();
panel.Spacing = 5;
panel.X = 50;
panel.Y = 50;
panel.AddToRoot();
var textBox = new TextBox();
textBox.Width = 200;
textBox.Placeholder = "Placeholder Text...";
panel.AddChild(textBox);
var textBox2 = new TextBox();
textBox2.Width = 200;
textBox2.Placeholder = "Placeholder Text...";
panel.AddChild(textBox2);
Typing

PreviewTextInput

IsReadOnly

MaxLength
Selection




CaretIndex

Placeholder
TextWrapping

TextWrapping.NoWrap causes text to scroll
TextWrapping.Wrap causes text to wrapEnter Key Behavior
Multi-Line Entry (AcceptsReturn)

Enter and Binding

Binding to Numeric Properties
Tab Key Behavior
Extended Character Sets and Keyboards

Last updated
Was this helpful?

