Mega Code Archive

 
Categories / VB.Net Tutorial / WPF
 

Grid with row and column definition and place buttons to grid cells

<Window x: Class="WpfApplication1.Window1"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     Title="Grid Demo">   <Grid>     <Grid.RowDefinitions>       <RowDefinition />     </Grid.RowDefinitions>     <Grid.ColumnDefinitions>       <ColumnDefinition />     </Grid.ColumnDefinitions>     <Button Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">A</Button>     <Button Grid.Row="0" Grid.Column="2">C</Button>     <Button Grid.Row="1" Grid.Column="0" Grid.RowSpan="2">D</Button>     <Button Grid.Row="1" Grid.Column="1">E</Button>     <Button Grid.Row="1" Grid.Column="2">F</Button>     <Button Grid.Row="2" Grid.Column="1">H</Button>     <Button Grid.Row="2" Grid.Column="2">I</Button>   </Grid> </Window>