Set Margins for TextBlock in Grid Resource : TextBlock « Windows Presentation Foundation « C# / CSharp Tutorial

Home
C# / CSharp Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statement
5.String
6.struct
7.Class
8.Operator Overload
9.delegate
10.Attribute
11.Data Structure
12.Assembly
13.Date Time
14.Development
15.File Directory Stream
16.Preprocessing Directives
17.Regular Expression
18.Generic
19.Reflection
20.Thread
21.I18N Internationalization
22.LINQ
23.GUI Windows Forms
24.Windows Presentation Foundation
25.Windows Communication Foundation
26.Workflow
27.2D
28.Design Patterns
29.Windows
30.XML
31.XML LINQ
32.ADO.Net
33.Network
34.Directory Services
35.Security
36.unsafe
C# / C Sharp
C# / C Sharp by API
C# / CSharp Open Source
C# / CSharp Tutorial » Windows Presentation Foundation » TextBlock 
24.7.13.Set Margins for TextBlock in Grid Resource
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  HorizontalAlignment="Center" VerticalAlignment="Stretch">

<Grid ShowGridLines="True">
  <Grid.Resources>
    <Style TargetType="TextBlock">
      <Setter Property="Margin" Value="5,3" />
    </Style>
  </Grid.Resources>

  <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto" />
    <ColumnDefinition />
  </Grid.ColumnDefinitions>
  <Grid.RowDefinitions>
    <RowDefinition Height="Auto" />
    <RowDefinition Height="2*" />
    <RowDefinition Height="1*" />
  </Grid.RowDefinitions>
  <TextBlock Grid.Column="0" Grid.Row="0">Key:</TextBlock>
  <TextBlock Grid.Column="1" Grid.Row="0">Value</TextBlock>
  <TextBlock Grid.Column="0" Grid.Row="1">A:</TextBlock>
  <TextBlock Grid.Column="1" Grid.Row="1">a</TextBlock>
  <TextBlock Grid.Column="0" Grid.Row="2">B:</TextBlock>
  <TextBlock Grid.Column="1" Grid.Row="2">b</TextBlock>

</Grid>



</Page>
WPF Set Margins For Text Block In Grid Resource
24.7.TextBlock
24.7.1.TextBlock VerticalAlignmentTextBlock VerticalAlignment
24.7.2.TextBlock ScaleTransform ScaleXTextBlock ScaleTransform ScaleX
24.7.3.TextBlock ScaleTransform ScaleY and TransformGroupTextBlock ScaleTransform ScaleY and TransformGroup
24.7.4.Adding Hyperlink to TextBlockAdding Hyperlink to TextBlock
24.7.5.Spell Check a TextBox or RichTextBox Control in Real TimeSpell Check a TextBox or RichTextBox Control in Real Time
24.7.6.Set TextBlock.FontSize for GridSet TextBlock.FontSize for Grid
24.7.7.Add TextBlock into a GridAdd TextBlock into a Grid
24.7.8.Intrinsic character direction in TextBlockIntrinsic character direction in TextBlock
24.7.9.Mixed character directions and TextBlockMixed character directions and TextBlock
24.7.10.FlowDirection of TextBlockFlowDirection of TextBlock
24.7.11.Use RenderTransform to transform a TextBlockUse RenderTransform to transform a TextBlock
24.7.12.Use LayoutTransform to transform a TextBlockUse LayoutTransform to transform a TextBlock
24.7.13.Set Margins for TextBlock in Grid ResourceSet Margins for TextBlock in Grid Resource
24.7.14.Set TextWrapping to True for TextBlockSet TextWrapping to True for TextBlock
24.7.15.Set ToolTip text for TextBlockSet ToolTip text for TextBlock
24.7.16.Set Text value for TextBlockSet Text value for TextBlock
24.7.17.Set Foreground color for TextBlockSet Foreground color for TextBlock
24.7.18.Add Border to TextBlockAdd Border to TextBlock
24.7.19.Put Rectangle into TextBlockPut Rectangle into TextBlock
24.7.20.Programmatically change the way in which TextBlock is trimmed when it exceeds the outer boundaries of its containing box.Programmatically change the way in which TextBlock is trimmed when it exceeds the outer boundaries of its containing box.
24.7.21.Effects of the enumerated values of TextWrapping.Effects of the enumerated values of TextWrapping.
24.7.22.VerticalAlignment=Top HorizontalAlignment=LeftVerticalAlignment=Top  HorizontalAlignment=Left
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.