wpf--- TextBlock text setting properties

   Important properties of the ProgressBar control:
        FontFamily - the font of the text
        displayed in the control FontSize - the size of the font displayed in the
        control Foreground - the foreground color of the text displayed in the control
        Text - the content of the displayed text TextWrapping - displayed in the    
        control The way the text wraps.

    NoWrap - no automatic line wrapping, the excess part is truncated,

    Wrap - automatic line wrapping, automatic line wrapping when the text length exceeds the width of the control.
        Visibility - The text is visible when the value is True, and invisible when the value is False.    
    < Canvas x:Name= "LayoutRoot"  Background= "White">
        FontSize - font size
        Foreground - text foreground color
        < TextBlock Text = "Information display control example - TextBlock"  Margin = "10,5,0,0"                   FontSize= "18"  FontWeight= "Bold"  Foreground= "#ffbe4d4d" />         < TextBlock Text= "1, display red text"  Foreground= "Red"  Canvas.Left= "10"  Canvas. 


"2. Display text with double quotation marks "TextBlock""  Canvas.Left= "10"  Canvas.Top= "60" />
        FontStretch - word spacing
        < TextBlock Text= "3. Text is underlined"  TextDecorations= "Underline"                   FontStretch= "Normal"  FontSize= "16"  Canvas.Left= "10"  Canvas.Top= "80" />         TextAlignment - horizontal alignment         TextWrapping - whether to wrap automatically         < TextBlock Text = "4, multi-line text display, When the length of the text exceeds the width of the TextBlock control, it will automatically wrap."                  TextAlignment= "Left" LineHeight="20" Width="200" 



 
 
                 TextWrapping= "Wrap"  Canvas.Left= "10"  Canvas.Top= "110" />
        < TextBlock Canvas.Left= "10"  Canvas.Top= "160"  FontStretch= "UltraExpanded">
            5. Not set by the Text property Text, place directly in the TextBlock container
        < /TextBlock>
        < TextBlock Canvas.Left= "10"  Canvas.Top= "180"  FontStretch= "UltraCondensed">
            6. Without setting the text through the Text property, place it directly in the TextBlock container
        < /TextBlock>
    < /Canvas>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325027210&siteId=291194637