![]() | TextBox Class |
Namespace: DigitalRune.Game.UI.Controls
The TextBox type exposes the following members.
Name | Description | |
---|---|---|
![]() | Arrange |
Positions child elements and determines a size for a control.
(Inherited from UIControl.) |
![]() | BringIntoView |
Attempts to bring this element into view, within any scrollable regions it is contained
within.
(Inherited from UIControl.) |
![]() | ClearSelection |
Clears the text selection.
|
![]() | Copy |
Copies the current selection from the text box to the clipboard.
|
![]() | Cut |
Removes the current selection from the text box and copies it to the clipboard.
|
![]() | Equals | (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | Focus |
Moves the input focus to this control.
(Inherited from UIControl.) |
![]() | GetControl |
Gets a control by name from the visual subtree of this control.
(Inherited from UIControl.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | GetValueT(Int32) |
Gets the value of the property with the given ID.
(Inherited from GameObject.) |
![]() | GetValueT(String) |
Gets the value of the property with the given name.
(Inherited from GameObject.) |
![]() | GetValueT(GamePropertyMetadataT) |
Gets the value of the property with the given metadata.
(Inherited from GameObject.) |
![]() | HitTest |
Tests if a position is over a control.
(Inherited from UIControl.) |
![]() | InvalidateArrange |
Invalidates the arrange state (layout) for the control.
(Inherited from UIControl.) |
![]() | InvalidateMeasure |
Invalidates the measurement state (layout) for the control.
(Inherited from UIControl.) |
![]() | InvalidateVisual |
Invalidates the cached RenderData.
(Inherited from UIControl.) |
![]() | Load |
Loads the content of the game object.
(Inherited from GameObject.) |
![]() | Measure |
Updates the DesiredWidth and DesiredHeight of the control.
(Inherited from UIControl.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | NewFrame |
Tells the game object to prepare itself for the next time step.
(Inherited from GameObject.) |
![]() | OnArrange |
Called by Arrange(Vector2F, Vector2F) to arrange the visual children.
(Overrides UIControlOnArrange(Vector2F, Vector2F).) |
![]() | OnHandleInput |
Called when the control should handle device input.
(Overrides UIControlOnHandleInput(InputContext).) |
![]() | OnLoad |
Called when the game object should load its content.
(Overrides UIControlOnLoad.) |
![]() | OnMeasure |
Called by Measure(Vector2F) to compute the control-specific desired size.
(Overrides UIControlOnMeasure(Vector2F).) |
![]() | OnPropertyChanged(PropertyChangedEventArgs) |
Raises the PropertyChanged event.
(Inherited from GameObject.) |
![]() | OnPropertyChangedT(GamePropertyT, T, T) |
Is called after a game object property was changed.
(Inherited from GameObject.) |
![]() | OnPropertyChangedT(GamePropertyT, T, T) |
Is called after a game object property was changed.
(Inherited from UIControl.) |
![]() | OnRender |
Called when the control and its visual children should be rendered.
(Inherited from UIControl.) |
![]() | OnTemplateChanged |
Raises the TemplateChanged event.
(Inherited from GameObject.) |
![]() | OnUnload |
Called when the game object should unload its content.
(Overrides UIControlOnUnload.) |
![]() | OnUpdate |
Called when the game object should be updated.
(Inherited from UIControl.) |
![]() | Paste |
Pastes the contents of the clipboard into the text box.
|
![]() | Render |
Renders the control (including visual children).
(Inherited from UIControl.) |
![]() | Select |
Selects a range of text in the text box.
|
![]() | SelectAll |
Selects all contents of the text box.
|
![]() | SetValueT(Int32, T) |
Sets the value of the property with the given ID.
(Inherited from GameObject.) |
![]() | SetValueT(String, T) |
Sets the value of the property with the given name.
(Inherited from GameObject.) |
![]() | SetValueT(GamePropertyMetadataT, T) |
Set the value of the property for the given metadata.
(Inherited from GameObject.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() | Unload |
Unloads the content of the game object.
(Inherited from GameObject.) |
![]() | Update |
Updates this game object.
(Inherited from GameObject.) |
![]() | UpdateLayout |
Ensures that all visual child controls of this element are properly updated for layout.
(Inherited from UIControl.) |
Name | Description | |
---|---|---|
![]() | GetAncestors |
Gets the ancestors of the control in the visual tree.
(Defined by UIHelper.) |
![]() | GetDescendants | Overloaded.
Gets the descendants of the control in the visual tree using a depth-first search.
(Defined by UIHelper.) |
![]() | GetDescendants(Boolean) | Overloaded.
Gets the descendants of the control in the visual tree using either a depth-first or a
breadth-first search.
(Defined by UIHelper.) |
![]() | GetLeaves |
Gets the leaves of the control in the visual tree.
(Defined by UIHelper.) |
![]() | GetRoot |
Returns the root control of the visual tree.
(Defined by UIHelper.) |
![]() | GetSelfAndAncestors |
Gets the control and its ancestors in the visual tree.
(Defined by UIHelper.) |
![]() | GetSubtree | Overloaded.
Gets the subtree (the given control and all of its descendants in the visual tree) using a
depth-first search.
(Defined by UIHelper.) |
![]() | GetSubtree(Boolean) | Overloaded.
Gets the subtree (the given control and all of its descendants in the visual tree) using
either a depth-first or a breadth-first search.
(Defined by UIHelper.) |
Name | Description | |
---|---|---|
![]() ![]() | GuideDescriptionPropertyId |
The ID of the GuideDescription game object property.
|
![]() ![]() | GuideTitlePropertyId |
The ID of the GuideTitle game object property.
|
![]() ![]() | IsPasswordPropertyId |
The ID of the IsPassword game object property.
|
![]() ![]() | IsReadOnlyPropertyId |
The ID of the IsReadOnly game object property.
|
![]() ![]() | MaxLengthPropertyId |
The ID of the MaxLength game object property.
|
![]() ![]() | MaxLinesPropertyId |
The ID of the MaxLines game object property.
|
![]() ![]() | MinLinesPropertyId |
The ID of the MinLines game object property.
|
![]() ![]() | PasswordCharacterPropertyId |
The ID of the PasswordCharacter game object property.
|
![]() ![]() | SelectionColorPropertyId |
The ID of the SelectionColor game object property.
|
![]() ![]() | TextPropertyId |
The ID of the Text game object property.
|
![]() ![]() | VerticalScrollBarStylePropertyId |
The ID of the VerticalScrollBarStyle game object property.
|
![]() ![]() | VerticalScrollBarVisibilityPropertyId |
The ID of the VerticalScrollBarVisibility game object property.
|
Name | Description | |
---|---|---|
![]() | ActualBounds |
Gets the actual bounding rectangle of the control (defined by ActualX,
ActualY, ActualWidth and ActualHeight).
(Inherited from UIControl.) |
![]() | ActualHeight |
Gets the actual height of the control (computed in
Arrange(Vector2F, Vector2F)).
(Inherited from UIControl.) |
![]() | ActualIsEnabled |
Gets a value indicating whether this control is actually enabled, taking into account the
IsEnabled flag and the state of the VisualParent.
(Inherited from UIControl.) |
![]() | ActualIsVisible |
Gets a value indicating whether this control is actually visible, taking into account the
IsVisible flag and the state of the VisualParent.
(Inherited from UIControl.) |
![]() | ActualWidth |
Gets the actual width of the control (computed in
Arrange(Vector2F, Vector2F)).
(Inherited from UIControl.) |
![]() | ActualX |
Gets the actual X position of the top left corner of the control's bounds in screen
coordinates (computed in Arrange(Vector2F, Vector2F)).
(Inherited from UIControl.) |
![]() | ActualY |
Gets the actual Y position of the top left corner of the control's bounds in screen
coordinates (computed in Arrange(Vector2F, Vector2F)).
(Inherited from UIControl.) |
![]() | AllowedPlayer |
Gets or sets the LogicalPlayerIndex from which input is accepted.
(Inherited from UIControl.) |
![]() | AutoUnfocus |
Gets or sets a value indicating whether this control clears the focus when the mouse clicks
another control than the currently focused control. This is a game object property.
(Inherited from UIControl.) |
![]() | Background |
Gets or sets the background color.
This is a game object property.
(Inherited from UIControl.) |
![]() | CaretIndex |
Gets or sets the position of the caret.
|
![]() | ContextMenu |
Gets or sets the context menu that should pop up when the control is right-clicked
(tap-and-hold on Windows Phone 7).
(Inherited from UIControl.) |
![]() | Cursor |
Gets or sets the mouse cursor that should be displayed when the mouse is over this control.
(Inherited from UIControl.) |
![]() | DesiredHeight |
Gets the desired height (including Margin) (which is computed in
Measure(Vector2F)).
(Inherited from UIControl.) |
![]() | DesiredWidth |
Gets the desired width (including Margin) (which is computed in
Measure(Vector2F)).
(Inherited from UIControl.) |
![]() | Events |
Gets the game object events.
(Inherited from GameObject.) |
![]() | Focusable |
Gets or sets a value indicating whether this UIControl can receive the input
focus. This is a game object property.
(Inherited from UIControl.) |
![]() | FocusWhenMouseOver |
Gets or sets a value indicating whether the control automatically receives focus when the
mouse is over the control (without being clicked). This is a game object property.
(Inherited from UIControl.) |
![]() | Font |
Gets or sets the font that is used if the control renders text.
This is a game object property.
(Inherited from UIControl.) |
![]() | Foreground |
Gets or sets the foreground color.
This is a game object property.
(Inherited from UIControl.) |
![]() | GuideDescription |
Gets or sets the description that is displayed with the software keyboard.
This is a game object property.
|
![]() | GuideTitle |
Gets or sets the title that is displayed with the software keyboard.
This is a game object property.
|
![]() | HasRenderTransform |
Gets a value indicating whether this control has a render transform that is not the
identity transformation.
(Inherited from UIControl.) |
![]() | Height |
Gets or sets the user-defined height.
This is a game object property.
(Inherited from UIControl.) |
![]() | HorizontalAlignment |
Gets or sets the horizontal alignment of this control.
This is a game object property.
(Inherited from UIControl.) |
![]() | InputService |
Gets the IInputService.
(Inherited from UIControl.) |
![]() | IsArrangeValid |
Gets a value indicating whether the Arrange(Vector2F, Vector2F) results are
up-to-date.
(Inherited from UIControl.) |
![]() | IsEnabled |
Gets or sets a value indicating whether this control is enabled.
This is a game object property.
(Inherited from UIControl.) |
![]() | IsFocused |
Gets a value indicating whether this control has the input focus.
This is a game object property.
(Inherited from UIControl.) |
![]() | IsFocusScope |
Gets or sets a value indicating whether this control is a focus scope.
This is a game object property.
(Inherited from UIControl.) |
![]() | IsFocusWithin |
Gets (or sets) a value indicating whether the focus is on this control or on any of
the visual children.
(Inherited from UIControl.) |
![]() | IsLoaded |
Gets a value indicating whether the content of this object was loaded.
(Inherited from GameObject.) |
![]() | IsMeasureValid |
Gets a value indicating whether the Measure(Vector2F) results
(DesiredWidth and DesiredHeight) are up-to-date.
(Inherited from UIControl.) |
![]() | IsMouseDirectlyOver |
Gets a value indicating whether the mouse is over this control and not over a visual child
control.
(Inherited from UIControl.) |
![]() | IsMouseOver |
Gets or sets a value indicating whether the mouse is over this control or over a visual
child. This is a game object property.
(Inherited from UIControl.) |
![]() | IsMultiline |
Gets a value indicating whether this text box is a multi-line text box that accepts ENTER
keys to create new lines.
|
![]() | IsPassword |
Gets or sets a value indicating whether this text box is a password box that displays
PasswordCharacters instead of the real characters. This is a game object
property.
|
![]() | IsReadOnly |
Gets or sets a value indicating whether this text box is read-only.
This is a game object property.
|
![]() | IsVisible |
Gets or sets a value indicating whether this control is visible.
This is a game object property.
(Inherited from UIControl.) |
![]() | IsVisualValid |
Gets a value indicating whether the cached RenderData is up-to-date.
(Inherited from UIControl.) |
![]() | Margin |
Gets or sets the margin.
This is a game object property.
(Inherited from UIControl.) |
![]() | MaxHeight |
Gets or sets the maximal height of the control.
This is a game object property.
(Inherited from UIControl.) |
![]() | MaxLength |
Gets or sets the maximal number of characters in the Text.
This is a game object property.
|
![]() | MaxLines |
Gets or sets the maximal number of visible lines.
This is a game object property.
|
![]() | MaxWidth |
Gets or sets the maximal width of the control.
This is a game object property.
(Inherited from UIControl.) |
![]() | MinHeight |
Gets or sets the minimal height of the control.
This is a game object property.
(Inherited from UIControl.) |
![]() | MinLines |
Gets or sets the minimal number of visible lines.
This is a game object property.
|
![]() | MinWidth |
Gets or sets the minimal width of the control.
This is a game object property.
(Inherited from UIControl.) |
![]() | Name |
Gets or sets the name.
(Inherited from GameObject.) |
![]() | Opacity |
Gets or sets the opacity.
This is a game object property.
(Inherited from UIControl.) |
![]() | Padding |
Gets or sets the padding.
This is a game object property.
(Inherited from UIControl.) |
![]() | PasswordCharacter |
Gets or sets the character that is used instead of normal character if
IsPassword is set. This is a game object property.
|
![]() | Properties |
Gets the game object properties.
(Inherited from GameObject.) |
![]() | RenderData |
Gets or sets the cached renderer data.
(Inherited from UIControl.) |
![]() | RendererInfo | Obsolete.
Gets or sets the cached renderer data.
(Inherited from UIControl.) |
![]() | RenderRotation |
Gets or sets the rotation of the RenderTransform.
This is a game object property.
(Inherited from UIControl.) |
![]() | RenderScale |
Gets or sets the scale of the RenderTransform.
This is a game object property.
(Inherited from UIControl.) |
![]() | RenderTransform |
Gets the render transformation.
(Inherited from UIControl.) |
![]() | RenderTransformOrigin |
Gets or sets the relative origin of the RenderTransform.
This is a game object property.
(Inherited from UIControl.) |
![]() | RenderTranslation |
Gets or sets the translation of the RenderTransform.
This is a game object property.
(Inherited from UIControl.) |
![]() | Screen |
Gets the UIScreen.
(Inherited from UIControl.) |
![]() | SelectedText |
Gets the content of the current selection in the text box.
|
![]() | SelectionColor |
Gets or sets the background color used for text selections.
This is a game object property.
|
![]() | Style |
Gets or sets the style.
(Inherited from UIControl.) |
![]() | Tag | Obsolete.
Gets or sets a user-defined tag.
(Inherited from UIControl.) |
![]() | Template |
Gets or sets the template.
(Inherited from GameObject.) |
![]() | Text |
Gets or sets the text.
This is a game object property.
|
![]() | ToolTip |
Gets or sets the tool tip.
This is a game object property.
(Inherited from UIControl.) |
![]() | UIService |
Gets the IUIService.
(Inherited from UIControl.) |
![]() | UserData |
Gets or sets user-defined data.
(Inherited from UIControl.) |
![]() | VerticalAlignment |
Gets or sets the vertical alignment of this control.
This is a game object property.
(Inherited from UIControl.) |
![]() | VerticalScrollBarStyle |
Gets or sets the style that is applied to the vertical ScrollBar.
This is a game object property.
|
![]() | VerticalScrollBarVisibility |
Gets or sets the ScrollBarVisibility of the vertical ScrollBar.
This is a game object property.
|
![]() | VisualCaret |
Gets the position of the top left corner of the caret rectangle/line.
|
![]() | VisualChildren |
Gets the visual children.
(Inherited from UIControl.) |
![]() | VisualClip |
Gets the clipping rectangle.
|
![]() | VisualOffset |
Gets the offset which is the horizontal offset for single-line text boxes or the vertical
offset for multi-line text boxes (see also MaxLines and
IsMultiline).
|
![]() | VisualParent |
Gets the visual parent.
(Inherited from UIControl.) |
![]() | VisualSelectionBounds |
Gets the bounds of the text selection (for rendering).
|
![]() | VisualState |
Gets the visual state of the control as string.
(Inherited from UIControl.) |
![]() | VisualText |
Gets the text exactly as it should be displayed (wrapping already applied).
|
![]() | Width |
Gets or sets the user-defined width.
This is a game object property.
(Inherited from UIControl.) |
![]() | X |
Gets or sets the x-position offset of the control. (Use this only for controls in a
Canvas or under the UIScreen.) This is a game object property.
(Inherited from UIControl.) |
![]() | Y |
Gets or sets the y-position offset of the control. (Use this only for controls in a
Canvas or under the UIScreen.) This is a game object property.
(Inherited from UIControl.) |
Name | Description | |
---|---|---|
![]() | InputProcessed |
Occurs after the device input was processed.
(Inherited from UIControl.) |
![]() | InputProcessing |
Occurs before the device input is processed.
(Inherited from UIControl.) |
![]() | PropertyChanged |
Occurs when a property value has changed.
(Inherited from GameObject.) |
![]() | TemplateChanged |
Occurs when the Template changed.
(Inherited from GameObject.) |
Name | Description | |
---|---|---|
![]() ![]() | INotifyPropertyChangedPropertyChanged |
Occurs when a property value has changed.
(Inherited from GameObject.) |
![]() ![]() | IAnimatableObjectGetAnimatablePropertyT |
Gets the property with given name and type which can be animated.
(Inherited from GameObject.) |
![]() ![]() | IAnimatableObjectGetAnimatedProperties |
Gets either the properties which are currently animated, or all properties which can be
animated. (See remarks.)
(Inherited from GameObject.) |
// Create a multi-line text box. var textBox = new TextBox { Margin = new Vector4F(4), Text = "Lorem ipsum dolor sit ...", MaxLines = 5, // Show max 5 lines of text. HorizontalAlignment = HorizontalAlignment.Stretch, }; // Add a context menu (Cut, Copy, Paste) to the text box. var contextMenu = new ContextMenu(); var cut = new MenuItem { Content = new TextBlock { Text = "Cut" } }; var copy = new MenuItem { Content = new TextBlock { Text = "Copy" } }; var paste = new MenuItem { Content = new TextBlock { Text = "Paste" } }; cut.Click += (s, e) => textBox.Cut(); copy.Click += (s, e) => textBox.Copy(); paste.Click += (s, e) => textBox.Paste(); contextMenu.Items.Add(cut); contextMenu.Items.Add(copy); contextMenu.Items.Add(paste); textBox.ContextMenu = contextMenu; // To show the text box, add it to an existing content control or panel. panel.Children.Add(textBox);