PARAGRAPHS in Visual Basic .NET

Painting QR Code in Visual Basic .NET PARAGRAPHS

PARAGRAPHS
Painting QR In VB.NET
Using Barcode printer for VS .NET Control to generate, create QR Code JIS X 0510 image in .NET framework applications.
www.OnBarcode.com
Read QR-Code In Visual Basic .NET
Using Barcode recognizer for Visual Studio .NET Control to read, scan read, scan image in Visual Studio .NET applications.
www.OnBarcode.com
The Paragraph element enables you to break the text in the RichTextBox into one or more separate paragraphs. Each paragraph can have its own formatting independent of the overall control. Listing 9.13 shows three different paragraphs, each with separate formatting independent of the overall control s formatting.
Generate QR-Code In VB.NET
Using Barcode creator for .NET Control to generate, create Denso QR Bar Code image in .NET framework applications.
www.OnBarcode.com
Generating Barcode In Visual Basic .NET
Using Barcode printer for Visual Studio .NET Control to generate, create Barcode image in .NET applications.
www.OnBarcode.com
Listing 9.13 RichTextBox showing paragraphs with different formatting and alignment
1D Barcode Creator In VB.NET
Using Barcode printer for .NET framework Control to generate, create Linear Barcode image in .NET applications.
www.OnBarcode.com
Drawing Matrix Barcode In VB.NET
Using Barcode drawer for .NET Control to generate, create 2D image in VS .NET applications.
www.OnBarcode.com
Result:
Encoding PDF-417 2d Barcode In VB.NET
Using Barcode generator for VS .NET Control to generate, create PDF-417 2d barcode image in .NET applications.
www.OnBarcode.com
GTIN - 12 Maker In Visual Basic .NET
Using Barcode drawer for .NET framework Control to generate, create UPC - E1 image in .NET framework applications.
www.OnBarcode.com
Download from Wow! eBook <www.wowebook.com>
QR-Code Maker In Java
Using Barcode generation for BIRT Control to generate, create QR-Code image in BIRT reports applications.
www.OnBarcode.com
QR Code Reader In Java
Using Barcode recognizer for Java Control to read, scan read, scan image in Java applications.
www.OnBarcode.com
226 XAML:
Encode Barcode In Java
Using Barcode maker for Java Control to generate, create Barcode image in Java applications.
www.OnBarcode.com
Scanning GTIN - 12 In Visual C#.NET
Using Barcode scanner for .NET Control to read, scan read, scan image in Visual Studio .NET applications.
www.OnBarcode.com
Text
Drawing ECC200 In .NET Framework
Using Barcode printer for .NET Control to generate, create DataMatrix image in Visual Studio .NET applications.
www.OnBarcode.com
Make QR Code JIS X 0510 In Objective-C
Using Barcode printer for iPad Control to generate, create QR-Code image in iPad applications.
www.OnBarcode.com
<RichTextBox x:Name="RichText" Width="350" Height="200"> <Paragraph> This is the first paragraph of the text I'm going to place in this RichTextBox. It has two sentences. Actually, it has three sentences. </Paragraph> <Paragraph TextAlignment="Justify" FontWeight="Bold"> This is the second paragraph, and its text is set to justify, as you can tell from the pretty screen shot. Please note that the last sentence in the paragraph is not justified. </Paragraph> <Paragraph TextAlignment="Right"> One ring to rule them all, one ring to bind them. One ring to bring them all, and in the darkness bind them, in the land of Mordor where the Shadows lie. </Paragraph> </RichTextBox>
Paint UPCA In Java
Using Barcode printer for Android Control to generate, create UCC - 12 image in Android applications.
www.OnBarcode.com
Generating UPC-A In .NET
Using Barcode maker for VS .NET Control to generate, create GTIN - 12 image in Visual Studio .NET applications.
www.OnBarcode.com
Listing 9.13 shows several interesting features. First, the text in a RichTextBox can be easily broken apart into separate paragraphs. The second feature is that each of those paragraphs can have formatting separate from the others. In this case, I used different text alignment on each of them and also set the middle paragraph to be bold. In addition to setting the styles at a paragraph level, you can surround blocks of text with formatting markup, called inline styles.
Barcode Creation In None
Using Barcode creator for Word Control to generate, create Barcode image in Word applications.
www.OnBarcode.com
EAN / UCC - 14 Generation In None
Using Barcode maker for Online Control to generate, create UCC-128 image in Online applications.
www.OnBarcode.com
INLINE STYLES AND SPANS
QR Code Reader In Java
Using Barcode recognizer for Java Control to read, scan read, scan image in Java applications.
www.OnBarcode.com
Read Denso QR Bar Code In C#.NET
Using Barcode reader for Visual Studio .NET Control to read, scan read, scan image in VS .NET applications.
www.OnBarcode.com
If formatting could be applied only at the paragraph level, the RichTextBox wouldn t be all that useful. Luckily, formatting can be applied at a much finer-grained level using inline formatting elements such as Bold, Italic, and the versatile Span. Listing 9.14 shows several formatting approaches in a single paragraph.
Listing 9.14 Inline styles and spans in the paragraph text
Result:
XAML:
<RichTextBox x:Name="RichText" Width="350" Height="125">
Download from Wow! eBook <www.wowebook.com>
Entering and displaying rich text
<Paragraph TextAlignment="Left"> One <Bold>ring</Bold> to <Span Foreground="Red">rule them all</Span>, one ring to find them. <Italic>One</Italic> ring to bring them all, and in the darkness bind them, <Span FontSize="18">in the land of Mordor where the Shadows lie.</Span> </Paragraph> </RichTextBox>
Listing 9.14 shows the use of the Bold and Italic inline styles, as well as Span. Bold and Italic are handy shortcuts, but Span is the most flexible of the three, supporting myriad formatting options. Span itself inherits from Inline and from that gets a number of useful properties. Section 9.2.1 goes into detail about the commonly used properties shared by the Span, TextBlock, and Run elements. In addition to these inline styles, the RichTextBox also supports LineBreaks via the LineBreak element:
One ring to rule them all,<LineBreak /> one ring to find them.<LineBreak />
As expected, the LineBreak element causes the text following it to start on a new line. You can think of the paragraph tag like the HTML <p></p> pair, and the LineBreak element much like the HTML <br /> tag. One thing that the other text-display controls can t include is a hyperlink. The RichTextBox is currently unique in its ability to display active Hyperlink controls.
INLINE HYPERLINKS
The RichTextBox has the ability to host any UIElement, but it has first-class support for hosting Hyperlinks without requiring any special containers or other work on your part, while keeping them active even for editable text. This makes it easy to display HTML-like text with embedded links. For example, listing 9.15 shows two Hyperlink elements embedded in the RichTextBox control.
Listing 9.15 Hyperlink support in the RichTextBox
Result:
XAML:
<RichTextBox x:Name="RichText" Width="350" Height="125"> <Paragraph TextAlignment="Left">
Download from Wow! eBook <www.wowebook.com>
Text
One ring to <Hyperlink NavigateUri="http://manning.com">rule them all, one ring to find</Hyperlink> them. <Italic>One </Italic> ring to bring them all, and in the darkness bind them, <Hyperlink NavigateUri="http://10rem.net"><Span FontSize="18">in the land of Mordor where the Shadows lie.</Span></Hyperlink> </Paragraph> </RichTextBox>
Listing 9.15 shows the use of two hyperlinks embedded in the paragraph text. Note how the hyperlinks also have support for cleanly nesting Spans and other formatting elements. The Hyperlink control in the RichTextBox is a fully functional Silverlight Hyperlink control, but it s not the same as the one you d place in regular XAML. Instead, it derives from Span. You can still wire up Click events, supply a NavigateUri as I did here, and otherwise do everything you d expect to be able to do with a Hyperlink. The Hyperlink control itself is covered in more detail later in this chapter. In addition to the Hyperlink control, RichTextBox includes support for hosting any other UIElement through the use of InlineUIContainer.
Copyright © OnBarcode.com . All rights reserved.