Circled Radio Buttons : RadioButton « Windows Presentation Foundation « C# / C Sharp






Circled Radio Buttons

Circled Radio Buttons
      
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Page.Resources>
        <ControlTemplate x:Key="newradio" 
                         TargetType="{x:Type RadioButton}">
            <Border Name="border" BorderBrush="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
                    Padding="10"
                    CornerRadius="100">
                <ContentPresenter />
            </Border>

            <ControlTemplate.Triggers>
                <Trigger Property="IsChecked" Value="True">
                    <Setter TargetName="border"
                            Property="BorderThickness"
                            Value="3" />
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
    </Page.Resources>

    <GroupBox Header="Options" FontSize="20pt">
        <StackPanel>
            <RadioButton Template="{StaticResource newradio}"
                         HorizontalAlignment="Center" 
                         Content="1" />
            <RadioButton Template="{StaticResource newradio}"
                         HorizontalAlignment="Center"
                         Content="2"
                         IsChecked="True" />
            <RadioButton Template="{StaticResource newradio}"
                         HorizontalAlignment="Center"
                         Content="3" />
        </StackPanel>
    </GroupBox>
</Page>

   
    
    
    
    
    
  








Related examples in the same category

1.Checked RadioButtonChecked RadioButton
2.Use StackPanel to Hold RadioButtonsUse StackPanel to Hold RadioButtons
3.Color animate based on Radio Button Click eventColor animate based on Radio Button Click event
4.Radio Button GroupsRadio Button Groups
5.Set RadioButton to check stateSet RadioButton to check state
6.Image RadioButtonImage RadioButton
7.RadioButton click eventRadioButton click event
8.Use RadioButton to control TextBox alignmentUse RadioButton to control TextBox alignment
9.RadioButton checked event handlerRadioButton checked event handler