Поделиться через


IXRTextBox (Compact 2013)

3/28/2014

This class represents a control that can be used to display single format, multiline text.

Syntax

class IXRTextBox : public IXRControl

Inheritance Hierarchy

IXRDependencyObject

    IXRUIElement

        IXRFrameworkElement

            IXRControl

                IXRTextBox

Methods

Method

Description

IXRTextBox::AddSelectionChangedEventHandler

Attaches a delegate to the SelectionChanged event for this text box. When the text box raises the SelectionChanged event, this delegate is invoked.

IXRTextBox::AddTextChangedEventHandler

Attaches a delegate to the TextChanged event for this text box. When the text box raises the TextChanged event, this delegate is invoked.

IXRTextBox::GetAcceptsReturn

Retrieves a value that determines whether this text box allows for and displays the new-line character or return character.

IXRTextBox::GetCaretBrush

Gets the brush that is used to render the vertical bar that indicates the insertion point in this text box.

IXRTextBox::GetFontSource

Retrieves the font source that is applied to this text box for displaying content.

IXRTextBox::GetHorizontalScrollBarVisibility

Retrieves a value that indicates the visibility of the horizontal scroll bar.

IXRTextBox::GetIsReadOnly

Retrieves a value that determines whether the user can change the text in this text box.

IXRTextBox::GetMaxLength

Retrieves the value that determines the maximum number of characters allowed for user input.

IXRTextBox::GetSelectedText

Retrieves the content of the current selection in this text box.

IXRTextBox::GetSelectionBackground

Retrieves the brush that fills the background of the selected text in this text box.

IXRTextBox::GetSelectionForeground

Retrieves the brush used for the selected text in this text box.

IXRTextBox::GetSelectionLength

Retrieves the number of characters in the current selection in this text box.

IXRTextBox::GetSelectionStart

Retrieves the starting position of the text selected in this text box.

IXRTextBox::GetText

Retrieves the text contents of this text box.

IXRTextBox::GetTextAlignment

Retrieves a value that indicates the horizontal alignment of text inside this text box.

IXRTextBox::GetTextWrapping

Retrieves a value that indicates how line breaking occurs if a line of text extends beyond the available width of this text box.

IXRTextBox::GetVerticalScrollBarVisibility

Retrieves a value that indicates the visibility of the vertical scroll bar.

IXRTextBox::RemoveSelectionChangedEventHandler

Removes a delegate from the SelectionChanged event for this text box.

IXRTextBox::RemoveTextChangedEventHandler

Removes a delegate from the TextChanged event for this text box.

IXRTextBox::Select

Selects a range of text in this text box.

IXRTextBox::SelectAll

Selects all the contents of this text box.

IXRTextBox::SetAcceptsReturn

Sets a value that determines whether this text box allows for and displays the new line character or return character. These characters are used to divide text into multiple lines.

IXRTextBox::SetCaretBrush

Sets the brush that is used to render the vertical bar that indicates the insertion point in this text box.

IXRTextBox::GetFontSource

Sets the font source that is applied to this text box for displaying content.

IXRTextBox::SetHorizontalScrollBarVisibility

Sets a value that determines the visibility of the horizontal scroll bar.

IXRTextBox::SetIsReadOnly

Sets a value that determines whether the user can change the text in this text box.

IXRTextBox::SetMaxLength

Sets a value that determines the maximum number of characters allowed for user input.

IXRTextBox::SetSelectedText

Sets the content of the current selection in this text box.

IXRTextBox::SetSelectionBackground

Sets the brush that fills the background of the selected text in this text box.

IXRTextBox::SetSelectionForeground

Sets the brush used for the selected text in this text box.

IXRTextBox::SetSelectionLength

Sets the number of characters in the current selection in this text box.

IXRTextBox::SetSelectionStart

Sets the starting position of the text selected in this text box.

IXRTextBox::SetText

Sets the text contents of this text box.

IXRTextBox::SetTextAlignment

Sets a value that indicates the horizontal alignment of text inside this text box.

IXRTextBox::SetTextWrapping

Sets a value that determines how line breaking occurs if a line of text extends beyond the available width of this text box.

IXRTextBox::SetVerticalScrollBarVisibility

Sets a value that determines the visibility of the vertical scroll bar.

Thread Safety

Members of this class are thread safe if you previously called IXRApplication::CreateHostFromXaml and supplied it with an XRWindowCreateParams structure that has AllowsMultipleThreadAccess set to true.

Remarks

You can enable multiline text in a text box control by using IXRTextBox::SetAcceptsReturn.

You might want to use a text box to display text, but you might not want users to be able to edit the text. To prevent users from doing this, you can call IXRTextBox::SetIsReadOnly. If you pass in true to this method, edit commands are not supported, and the KeyUp and KeyDown events are specified as handled.

If you must have formatted text that cannot be edited by the user, use the IXRTextBlock class instead. If you must have an editable text box that accepts passwords or other input, use the IXRPasswordBox class instead.

You can modify the border of a text box by using the inherited methods IXRControl::SetBorderThickness and IXRControl::SetBorderBrush.

When you create a class instance, use an IXRTextBoxPtr smart pointer instead of a raw interface pointer. For more information, see XRPtr<Interface>.

You can also define a text box control in Microsoft Silverlight 3 XAML. For information about the differences between XAML in XAML for Windows Embedded and Silverlight 3, see Differences Between Microsoft Silverlight 3 and XAML for Windows Embedded. For more information about how to define this element in the source XAML for your application, see the TextBox Class on MSDN.

.NET Framework Equivalent

System.Windows.Controls.TextBox

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

Classes for UI Element Management