C#/WPF
WPF tutorial - The Grid - GridSplitter, A contact form
광그로
2017. 6. 22. 18:12
http://www.wpf-tutorial.com/panels/gridsplitter/
GridSplitter을 이용하면 row 혹은 column의 비율을 사용자가 변경할 수 있습니다.
1 2 3 4 5 6 7 8 9 10 | <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="5" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <TextBlock FontSize="55" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap">Left side</TextBlock> <GridSplitter Grid.Column="1" Width="5" HorizontalAlignment="Stretch" /> <TextBlock Grid.Column="2" FontSize="55" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap">Right side</TextBlock> </Grid> | cs |
중앙에 위치한 GridSplitter을 이용하여 좌우측의 비율을 조정할 수 있습니다.
http://www.wpf-tutorial.com/panels/grid-usage-example-contact-form/
연락처 양식
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <Grid Margin="10"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Label>Name:</Label> <TextBox Grid.Column="1" Margin="0,0,0,10" /> <Label Grid.Row="1">E-mail:</Label> <TextBox Grid.Row="1" Grid.Column="1" Margin="0,0,0,10" /> <TextBox Grid.Row="2" Grid.ColumnSpan="2" AcceptsReturn="True" /> </Grid> | cs |