새로운 여러 컨트롤을 갖는 온라인 자습서를 통해 learing과 몇 가지 질문이 있습니다하나의 WPF 그리드 셀 WPF에
(1) 나는 폭이 다른 여러 개의 버튼이 하나의 WPF에서 나란히 나타나도록 노력하고 있어요 그리드 셀. 그러나, 그들은 항상 서로 쌓여있는 것처럼 보입니다. 나는 무엇을 놓치고 있습니까?
(2) 그리드 셀 내의 각 버튼에 대한 절대 시작 왼쪽 위치를 제어 할 수 있습니까?
감사합니다.
살바도르의 답변에 따라<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
<ScrollViewer>
<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
ShowGridLines ="True" >
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="60*" />
</Grid.ColumnDefinitions>
<Button Content="Button No. 1" Grid.Row="0" Grid.Column="0" />
<GridSplitter HorizontalAlignment="Center" Width="6"
Grid.Row="0" Grid.Column="1" Grid.RowSpan="3" />
<Button Content="Button No. 4-2" Grid.Row="0" Grid.Column="2" Width="100" />
<Button Content="Button No. 4-1" Grid.Row="0" Grid.Column="2" Width="50" />
</Grid>
</ScrollViewer>
</Page>
이 작동 :
<Button VerticalAlignment="Top" HorizontalAlignment="Left" Content="Button No. 1" Grid.Row="0" Grid.Column="0" Height="100"/>
<GridSplitter HorizontalAlignment="Center" Width="6"
Grid.Row="0" Grid.Column="1" Grid.RowSpan="3" />
<Button VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0" Content="Button No. 4-2" Grid.Row="0" Grid.Column="2" Height="100" Width="100" />
<Button VerticalAlignment="Top" HorizontalAlignment="Left" Margin="400,0,0,0" Content="Button No. 4-1" Grid.Row="0" Grid.Column="2" Height="150" Width="50" />
감사합니다!
완벽하고, 내가 원하는대로 작동합니다. – Shawn