如何在wpf c#中对齐单选按钮控件,控件的按钮比文本稍高。如何将它们对齐在同一高度?

问题描述 投票:0回答:1
c# wpf
1个回答
0
投票

多亏了副驾驶,我才能够修好它。

这是工作代码:

<GroupBox Grid.Row="1" Header="Folder Selection" Margin="0,0,0,10">
    <StackPanel>
        <StackPanel Orientation="Horizontal" Margin="0,0,0,10">
            <RadioButton Content="Save in Same Folder" IsChecked="{Binding IsSaveInSameFolder}" FontSize="16" VerticalAlignment="Center" VerticalContentAlignment="Center"/>
            <RadioButton Content="Save in Custom Folder" IsChecked="{Binding IsSaveInCustomFolder}" FontSize="16" VerticalAlignment="Center" VerticalContentAlignment="Center" Margin="20,0"/>
        </StackPanel>
        <StackPanel Orientation="Horizontal" Margin="0,0,0,10">
            <TextBox Width="300" Text="{Binding SelectedFolderPath}" FontSize="14" VerticalAlignment="Center" IsEnabled="{Binding IsSaveInCustomFolder}" />
            <Button Content="Browse" Width="80" Height="30" VerticalAlignment="Center" Margin="10,0,0,0" Command="{Binding BrowseFolderCommand}" IsEnabled="{Binding IsSaveInCustomFolder}"/>
        </StackPanel>
    </StackPanel>
</GroupBox>
© www.soinside.com 2019 - 2024. All rights reserved.