I. The TextBlock text is arranged vertically with two modes of output.
1. Text is placed normally, just vertically.
2. The text also rotates 90 degrees, arranged vertically.
Two. See examples below
1. Normal placement of text, vertical arrangement.
(1) Backstage Code
string s = text01. Text; "" ; int a = s.length; for (int0; i < A; i++) { 1) +"\ n";
(2) Front code
<textblock name="text01" text=" input and output " textwrapping=" Wrap"/>
(3) Effect
(4) principle
Each time you get a character for the text, then wrap it, get the next character, continue wrapping, and loop to the end of all the characters.
2. The text is placed in a normal, vertical arrangement in another way.
(1) Code
<textblock name="text01" textwrapping="Wrap" text=" input and output " margin="30,10" fontsize="20 "width="/>
(2) Effect
(3) principle
You can do this by setting the width of the TextBlock smaller and then wrapping it automatically.
3. The text also rotates 90 degrees, arranged vertically.
(1) Code
<Grid> <Grid.RowDefinitions> <rowdefinition height="Auto"/> <rowdefinition height="*"/> </Grid.RowDefinitions> <textblock name="text01"text="Input and Output"textwrapping="Wrap"height=" -"Horizontalalignment=" Left"Fontsize=" -"margin="30,10"> <TextBlock.LayoutTransform> <rotatetransform angle=" -"/> </TextBlock.LayoutTransform> </TextBlock> </Grid>
(2) Effect
3. Principle: Just use a rotation method.
WPF TextBlock Text Portrait arrangement