WPF notes (2.7 text layout) -- Layout

Source: Internet
Author: User
This section describes the text layout controls:

1. textblock's most basic text Control
Five font attributes can be configured.
For the textwraping attribute, "Wrap" is a line break, while nowrap is a line break (incorrect original book, correct it here ).
The textblock control can contain many controls, not just text. < Textblock textwraping = " Wrap " >
< Button > Split </ Button >
< Checkbox > Across </ Checkbox >
< Textbox > Multiple </ Textbox >
Lines
</ Textblock >

Accesstext, bold, hyperlink, italic, and underline have been removed. (Accesstext has no expected effect) < Textblock fontsize = " 18 " >
< Accesstext > T </ Accesstext > His < Italic > Is </ Italic >   < Bold > Rather </ Bold >
< Underline > Messy </ Underline > . < Hyperlink > Www.example.com </ Hyperlink >
</ Textblock >

2. Text and whitespace
Here, whitespace refers to the carriage return character, that is, textblock ignores it. The carriage return line is displayed only when XML: Space = "preserve" is set in textblock: < Textblock fontsize = " 18 " XML: Space = " Preserve " >
< Accesstext > T </ Accesstext > His < Italic > Is </ Italic >   < Bold > Rather </ Bold >
< Underline > Messy </ Underline > . < Hyperlink > Www.example.com </ Hyperlink >
</ Textblock >

Of course, it is generally not recommended to take the initiative to do this unless you directly copy a large segmentArticleCome here.
You can set XML: Space = "preserve" <Bold>Rather</Bold>.

You can set the textalignment = "Left"/right/center/justify attribute to control the text alignment in textblock. Justify is center alignment.


3. textflow is more powerful than textblock and provides five embedded container labels:
1) Paragraph
2) List
3) Table
4) floater
5) figure
Looking at these five containers in a rough way, this is nothing more than the migration of Five layout solutions in Word. Moreover, Microsoft's white paper said that textblock is much more efficient than textflow, try to use the latter.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.