O'Reilly logo

XAML Unleashed by Adam Nathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Text Selection

TextBox exposes straightforward and familiar members for text selection—SelectionHighlightColor, SelectAll, Select, SelectedText, SelectionStart, SelectionLength, and GetRectFromCharacterIndex. However, unlike TextBlock and RichTextBlock, these are based on simple int character indices rather than TextPointer objects.

In addition to the Select All and Copy commands supported by TextBlock and RichTextBlock, TextBox’s editable nature enables it to provide automatic support for Cut, Paste, Undo, and Redo as well. The availability of every command except Select All depends on context, but Figure 12.20 shows the built-in context menu when every command is available.

FIGURE 12.20 TextBox supports all the standard text commands via ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required