May 2013
Intermediate to advanced
1152 pages
82h 34m
English
You can format text in a RichTextBox at the paragraph-level and inline-level at runtime. The following example shows how you can right-align the entire contents of the RichTextBox within a Button.Tap event handler:
void Button_Tap(object sender, System.Windows.Input.GestureEventArgs e){ foreach (Block block in richTextBox1.Blocks) { block.TextAlignment = TextAlignment.Right; }}
Figure 6.11 shows the contents of a RichTextBox after it has been right-aligned via a Button placed within the Paragraph.
FIGURE 6.11 Tapping an inline Button causes the Paragraph to be right-aligned. ...
Read now
Unlock full access