Shared Size Groups : Grid « Windows Presentation Foundation « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Date Time
8.Development
9.Event
10.File Directory
11.Generics
12.GUI
13.Internationalization I18N
14.Language Basics
15.LINQ
16.Network Remote
17.Reflection
18.Security
19.Thread
20.Windows Presentation Foundation
21.Windows System
22.XML
23.XML LINQ
VB.Net Tutorial
VB.Net by API
VB.Net » Windows Presentation Foundation » GridScreenshots 
Shared Size Groups
Shared Size Groups
        
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  HorizontalAlignment="Center" VerticalAlignment="Center">
<DockPanel Grid.IsSharedSizeScope="True">
  <Grid DockPanel.Dock="Top">
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="*" />
      <ColumnDefinition Width="Auto" SharedSizeGroup="Location" />
      <ColumnDefinition Width="Auto" SharedSizeGroup="Rank" />
      <ColumnDefinition Width="Auto" />
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>

    <Border Grid.Column="0" Grid.Row="0" BorderThickness="1" Background="LightGray" BorderBrush="Gray">
      <TextBlock>A</TextBlock>
    </Border>
    <Border Grid.Column="1" Grid.Row="0" BorderThickness="1" Background="LightGray" BorderBrush="Gray">      
    <TextBlock>B</TextBlock>
    </Border>
    <Border Grid.Column="2" Grid.Row="0" BorderThickness="1" Grid.ColumnSpan="2" Background="LightGray" BorderBrush="Gray">
    </Border>
    <TextBlock Grid.Column="2" Grid.Row="0">C</TextBlock>
    <FrameworkElement Grid.Column="3" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" />
  </Grid>
  <ScrollViewer>
    <Grid>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="Auto" SharedSizeGroup="Location" />
        <ColumnDefinition Width="Auto" SharedSizeGroup="Rank" />
      </Grid.ColumnDefinitions>
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" />
      </Grid.RowDefinitions>

      <TextBlock Grid.Column="0" Grid.Row="0" Text="WPF" />
      <TextBlock Grid.Column="1" Grid.Row="0" Text="this" />
      <TextBlock Grid.Column="2" Grid.Row="0">is</TextBlock>

      <TextBlock Grid.Column="0" Grid.Row="1">a</TextBlock>
      <TextBlock Grid.Column="1" Grid.Row="1">test</TextBlock>
      <TextBlock Grid.Column="2" Grid.Row="1">.</TextBlock>
    </Grid>
  </ScrollViewer>
</DockPanel>
</Page>

   
    
    
    
    
    
    
    
  
Related examples in the same category
1.The first row of a gridThe first row of a grid
2.Positioning elements using a Grid
3.Layout within a button using GridLayout within a button using Grid
4.Label in a GridLabel in a Grid
5.Display Content in Resizable Split PanelDisplay Content in Resizable Split Panel
6.Place more than two object to one cellPlace more than two object to one cell
7.Add StackPanel to Row 0Add StackPanel to Row 0
8.Using the attached properties of Grid
9.Two columns and three rows columnsTwo columns and three rows columns
10.Fixed column widthFixed column width
11.Grid with row and column definition and place buttons to grid cellsGrid with row and column definition and place buttons to grid cells
12.DoubleSplit WindowDoubleSplit Window
13.Grid PreviewMouseDown action and MouseDown actionGrid PreviewMouseDown action and MouseDown action
14.Grid MouseMoveGrid MouseMove
15.Grid MouseLeftButtonDownGrid MouseLeftButtonDown
16.Grid MouseLeftButtonUpGrid MouseLeftButtonUp
17.Use the Grid to create a dialog box that uses the WPF layout API
18.Is Grid ReadOnlyIs Grid ReadOnly
19.Dynamically add Button to a Grid and add Action listenerDynamically add Button to a Grid and add Action listener
20.Setting Grid row heights in codeSetting Grid row heights in code
21.Layout Controls with Grid in codeLayout Controls with Grid in code
22.Show Grid lines in codeShow Grid lines in code
23.Grid mouse down eventGrid mouse down event
24.Grid Preview mouse down eventGrid Preview mouse down event
25.Put Button onto a GridPut Button onto a Grid
26.Use the IsSharedSizeScope attached property of the Grid elementUse the IsSharedSizeScope attached property of the Grid element
27.Change the margins of an element that is within a Grid by XAML and programmatic codeChange the margins of an element that is within a Grid by XAML and programmatic code
28.Programmatically use the positioning methods of GridProgrammatically use the positioning methods of Grid
29.Add a ColumnDefinition to GridAdd a ColumnDefinition to Grid
30.Add a RowDefinition to GridAdd a RowDefinition to Grid
31.Clear All ColumnsClear All Columns
32.Clear All RowsClear All Rows
33.Remove One ColumnRemove One Column
34.Remove One RowRemove One Row
35.The current number of ColumnsThe current number of Columns
36.The current number of RowsThe current number of Rows
37.Remove 5 Columns with ColumnDefinitions.RemoveRangeRemove 5 Columns with ColumnDefinitions.RemoveRange
38.Remove 5 Row with RowDefinitions.RemoveRange
39.Contains RowContains Row
40.Contains Column?Contains Column?
41.Insert RowInsert Row
42.Insert ColumnInsert Column
43.Set control to specific row and column in codeSet control to specific row and column in code
44.The default GroupStyle indents the items in a groupThe default GroupStyle indents the items in a group
45.A resizable layoutbased on GridA resizable layoutbased on Grid
w___ww_.__j___a___v__a__2___s__._c___o___m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.