WPF RadioButton GroupName

<Window x:Class="WpfApp375.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApp375"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <StackPanel>
        <StackPanel>
            <RadioButton GroupName="A">Option 1</RadioButton>
            <RadioButton GroupName="A">Option 2</RadioButton>
        </StackPanel>
        <StackPanel>
            <RadioButton GroupName="A">Option3</RadioButton>
        </StackPanel>

        <StackPanel>
            <RadioButton GroupName="B">Option 11</RadioButton>
            <RadioButton GroupName="B">Option 12</RadioButton>
            <RadioButton GroupName="C">A Different Option 1</RadioButton>
            <RadioButton GroupName="C">A Different Option 2</RadioButton>
        </StackPanel>
    </StackPanel>
</Window>

 

posted @ 2024-09-18 16:37  FredGrit  阅读(48)  评论(0)    收藏  举报