StackPanel
은 시각적 공간을 신경 쓰지 않습니다. 가능한 최소한의 공간을 차지하려고합니다. 아래 내 예에서와 같이, DockPanel
을 당신은 장소에 라디오 버튼을 감싸는 안쪽 StackPanel
을 떠날 수 있지만 외부 레이아웃 컨테이너가 Grid
변경해야하거나 :
<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="445" Width="515">
<DockPanel Name="spDataFlow" Margin="0,45,0,0" >
<DockPanel x:Name="stkPnlDataFlow" VerticalAlignment="Top">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
</Grid>
<StackPanel Grid.Row="1" Background="Red" Margin="20,15,0,0" Orientation="Horizontal" VerticalAlignment="Center" >
<RadioButton Name="rdbtnUploadData" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="12" Foreground="White" Content="Upload Data" IsEnabled="True" CommandParameter="UploadAll"/>
<RadioButton Name="rdbtnDownloadData" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="12" Foreground="White" Content="Download Data" Margin="20,0" CommandParameter="DownloadAll"/>
<RadioButton Name="rdbtnUploadSelected" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="12" Foreground="White" Content="Update Data" Margin="10,0" CommandParameter="UpdateSelected"/>
</StackPanel>
</DockPanel>
</DockPanel>
</Window>
안녕 롭, 도움을 주셔서 감사합니다 ..하지만 어떻게 든이 couldnt는 운동한다. 아직 화면 오른쪽에 빈 공간이 있습니다. 감사합니다. ramm – Ramm
그 공간을 무엇을 차지하고 싶습니까? 라디오 버튼을 멀리 퍼트 리시겠습니까? 이 경우 가장 안쪽의 StackPanel을 교체해야합니다. –