WPF RadioButton Control:
RadioButton controls are usually grouped together to offer user a single choice among several options (only one button at a time can be selected).
<RadioButton> </Radiobutton> tag is used too create the radio button in XAML.
Properties:
In the following tag I create the RadioButton in which Height is height of the RadioButton, Name is the nameof the RadioButton, text in the between the RadioButton tag is the centent visibile to user. Background the the color of the box, Borderbrush is the color of the border, Forground is the color of the text.
<RadioButton Height="16" Margin="26,18,132,0" Name="rdA2zDotnet" VerticalAlignment="Top" Background="DarkOrange" BorderBrush="DarkOrchid" Foreground="DarkBlue">A2ZDotNet.com</RadioButton>
It Would look like

To change the orientation from left to right use the FlowDirection property to RightToLeft.
It would like after changing the orientation

RadioButton is used in the group so that user can select only one option from the available options (No extra coding is required to uncheck others). Use same GroupName of the radiobuttons to mark in a group so that only one option can be selected as follows.
<StackPanel >
<RadioButton Height="19" Name="rdA2zDotnet" Background="DarkOrange" BorderBrush="DarkOrchid" GroupName="A2zDotnet" Foreground="DarkBlue">A2ZDotNet.com</RadioButton>
<RadioButton Height="16" Margin="0,0,0,0" Name="rdInterview" Content="C# Interview Questions" GroupName="A2zDotnet"></RadioButton>
<RadioButton Height="16" Margin="0,0,0,0" Name="rdWPFInterview" Content="WPF Interview Questions" GroupName="A2zDotnet"></RadioButton>
</StackPanel>
Events:
Checked and Unchecked are the main event of the radiobutton which might be require to handle.
Add following handler for these events Checked="rdA2zDotnet_OnChecked" Unchecked="rdA2zDotnet_OnUnchecked" to rdA2zDotnet radio button.
Now write the code to the handler so that we can take appropriate action on these events in windows1.xaml.cs.
protected void rdA2zDotnet_OnChecked(object sender, RoutedEventArgs e)
{
MessageBox.Show("Please visit www.A2ZDotNet.com for the WPF tutorials");
}
protected void rdA2zDotnet_OnUnchecked(object sender, RoutedEventArgs e)
{
}
Finding out which radiobutton is checked use the property IsChecked as follows in the Go button
private void btnGo_Click(object sender, RoutedEventArgs e)
{
if (rdA2zDotnet.IsChecked == true)
System.Diagnostics.Process.Start(@"http://www.a2zdotnet.com");
else if(rdInterview.IsChecked == true)
System.Diagnostics.Process.Start(@"http://a2zdotnet.com/Interview.aspx?id=5");
else if(rdWPFInterview.IsChecked == true)
System.Diagnostics.Process.Start(@"http://a2zdotnet.com/Interview.aspx?id=4");
}
Summary: Radio button is very simple control and used for selecting only one option from the available options.