In This Article

TextBox Class

Represents a textbox ribbon control.

public class TextBox : TextBoxBase, IKeyTipTarget, IVariantControl
Inheritance:
object Visual UIElement FrameworkElement Control TextBoxBase TextBox TextBoxBase object
Implements:
IKeyTipTarget IVariantControl

Remarks

For detailed documentation on this control's features and how to use them, please see the TextBox documentation topic.

Constructors

TextBox()

Initializes an instance of the TextBox class.

public TextBox()

TextBox(ICommand)

Initializes an instance of the TextBox class.

public TextBox(ICommand command)
Parameter Type Description
command ICommand

The ICommand to assign to the button.

Methods

CoerceCommandParameter(DependencyObject, object)

Coerces a new CommandParameterProperty value.

protected override object CoerceCommandParameter(DependencyObject obj, object value)
Parameter Type Description
obj DependencyObject

The System.Windows.DependencyObject whose property is changed.

value object

The new value being set.

Returns

object:

The coerced value to set.

OnClick(ExecuteRoutedEventArgs)

Called when the control is clicked and a Click event is raised

protected override void OnClick(ExecuteRoutedEventArgs e)
Parameter Type Description
e ExecuteRoutedEventArgs

An ExecuteRoutedEventArgs that contains the event data.

OnGotKeyboardFocus(KeyboardFocusChangedEventArgs)

Occurs after the control gains keyboard focus.

protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
Parameter Type Description
e KeyboardFocusChangedEventArgs

A KeyboardFocusChangedEventArgs that contains the event data.

OnKeyDown(KeyEventArgs)

Occurs when a key is pressed while the control has focus.

protected override void OnKeyDown(KeyEventArgs e)
Parameter Type Description
e KeyEventArgs

A KeyEventArgs that contains the event data.

OnLostKeyboardFocus(KeyboardFocusChangedEventArgs)

Occurs after the control loses keyboard focus.

protected override void OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e)
Parameter Type Description
e KeyboardFocusChangedEventArgs

A KeyboardFocusChangedEventArgs that contains the event data.

SetText(string)

Sets the Text property and can optionally perform other operations.

protected override void SetText(string text)
Parameter Type Description
text string

The text.

UpdateCanExecute()

Updates whether the command can execute.

protected override void UpdateCanExecute()

Inherited Members