Star sizing Grid : Grid « Containers « Silverlight






Star sizing Grid

Star sizing Grid
    

<UserControl x:Class='SilverlightApplication3.MainPage'
    xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' 
    xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
    xmlns:d='http://schemas.microsoft.com/expression/blend/2008' 
    xmlns:mc='http://schemas.openxmlformats.org/markup-compatibility/2006' 
    mc:Ignorable='d' 
    d:DesignWidth='640' 
    d:DesignHeight='480'>
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="2*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Border Grid.Row="0" Grid.Column="0" Background="Beige">
            <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                <TextBlock HorizontalAlignment="Center" Text="Row = 0"/>
                <TextBlock HorizontalAlignment="Center" Text="Column = 0"/>
            </StackPanel>
        </Border>
        <Border Grid.Row="0" Grid.Column="1" Background="BurlyWood">
            <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="Row = 0, Column = 1"/>
        </Border>
    </Grid>
</UserControl>

   
    
    
    
  








Related examples in the same category

1.Positioning UI Elements with a GridPositioning UI Elements with a Grid
2.A Simple Grid ControlA Simple Grid Control
3.Span two rows and two columns with an Image control
4.Implementing a Grid to Set the Layout of Silverlight Controls
5.Grid exampleGrid example
6.ColumnSpan exampleColumnSpan example
7.Grid example 2* row and column definitionsGrid example 2* row and column definitions
8.Use Grid to layout a CalendarUse Grid to layout a Calendar
9.Set Grid Row and Column for a Button
10.Grid with Column Definition and Row definitionGrid with Column Definition and Row definition
11.Define rows / columns for GridDefine rows / columns for Grid
12.Using Grid.ColumnSpanUsing Grid.ColumnSpan
13.Set Grid Row Height and Column Width to AutoSet Grid Row Height and Column Width to Auto
14.Mixing row height stylesMixing row height styles
15.Show Grid LinesShow Grid Lines
16.Multiple Items in a Grid CellMultiple Items in a Grid Cell
17.Grid in ScrollViewerGrid in ScrollViewer
18.Margin vs Padding and Grid
19.ColumnDefinition.Width=Auto
20.Bind to Grid Width and Height
21.Set Row and Column Index when Adding Buttons to Grid
22.Put more than one Object to one Grid Cell
23.Set Column and Row index when adding Controls to a Grid
24.Empty RowDefinition and ColumnDefinition
25.Use the Grid element to create a standard user interface (UI) dialog box.
26.Place and size rectangles and ellipses in Grid cellsPlace and size rectangles and ellipses in Grid cells
27.Use Image as the Grid backgroundUse Image as the Grid background
28.Automatic Width and HeightAutomatic Width and Height
29.Layout Controls with Grid in codeLayout Controls with Grid in code
30.Set control to specific row and column in codeSet control to specific row and column in code
31.Show Grid lines in codeShow Grid lines in code
32.A basic Grid using star sizing.A basic Grid using star sizing.
33.A basic Grid using auto sizingA basic Grid using auto sizing
34.The basic syntax of a GridThe basic syntax of a Grid
35.Arranging content within a GridArranging content within a Grid
36.Proportional GridProportional Grid
37.Nested GridsNested Grids
38.Grid cell stretch modeGrid cell stretch mode
39.Programmatically adding a row and a column while setting the height and widthProgrammatically adding a row and a column while setting the height and width
40.Programmatically removing a row and a columnProgrammatically removing a row and a column
41.The basic syntax and usage of a GridSplitterThe basic syntax and usage of a GridSplitter
42.Grid mouse button up eventGrid mouse button up event