---
title: "RadioButton Control in WPF"  
description: "Whenever you want to checked only one value in available items then we can use RadioButton control. RadioButton control has all the property like chec"  
author: "Anonymous User"  
published: 2011-03-30  
updated: 2020-03-04  
canonical: https://www.mindstick.com/articles/522/radiobutton-control-in-wpf  
category: "wpf"  
tags: ["wpf"]  
reading_time: 2 minutes  

---

# RadioButton Control in WPF

Whenever you want to checked only one value in available items then we can use [RadioButton](https://www.mindstick.com/blog/233/get-checked-radiobutton-using-javascript) control. RadioButton control has all the [property](https://www.mindstick.com/articles/198559/an-ownership-of-property-in-hua-hin) like [checkbox control](https://www.mindstick.com/articles/291/how-should-use-checkbox-control-in-vb-dot-net) except that in checkbox we can check [multiple](https://www.mindstick.com/blog/12797/iowa-is-expected-to-see-heavy-growth-in-multiple-sectors) items while in radiobutton we can check only one item. In this demonstration I will tell you how to use radiobutton control in WPF.\

##### Some common properties related with radio button radiobutton control

- **Name**—Name property is used to provide a unique name to your radiobutton control.
- **GroupName**—GroupName property is used to create a group for your radio [button control](https://www.mindstick.com/articles/290/button-control-in-vb-dot-net). Basically group means among those values in which you want to select only one value.
- **Content**—Content property is used to provide some content to radiobutton control.
- **FlowDirection**—FlowDirection property used to set [direction](https://yourviews.mindstick.com/story/5034/10-animals-with-the-best-sense-of-direction) of content on control. It has two [possible values](https://www.mindstick.com/forum/23337/hibernate-hbm2ddl-auto-possible-values-and-what-they-do) one is LeftToRight and another is RightToLeft.
- **IsChecked**—IsChecked property is used to [check whether](https://www.mindstick.com/forum/457/what-is-the-best-way-to-check-whether-a-trigger-exists-in-sql-server) radiobutton is checked or not.
- **Checked**—Basically checked is an event which fired whenever user checked the radiobutton control.
- **Unchecked**—Unchecked is another event in radiobutton which is fired whenever a radiobutton is unchecked.

##### Code snippet for creating radiobutton control

```
<Grid>        <RadioButton Content="RadioButton1" Height="20" HorizontalAlignment="Left" Margin="121,92,0,0" x:Name="rr1" VerticalAlignment="Top" GroupName="SampleGroup" Checked="rr1_Checked" />        <RadioButton Content="RadioButton2" Height="20" HorizontalAlignment="Left" Margin="257,92,0,0" x:Name="rr2" VerticalAlignment="Top" GroupName="SampleGroup" Checked="rr2_Checked" />        <Label  Height="28" HorizontalAlignment="Left" Margin="96,130,0,0" x:Name="lblMessage" VerticalAlignment="Top" Width="284" /></Grid>  //This event is fired when user checked first radio button.          private void rr1_Checked(object sender, RoutedEventArgs e)        {            lblMessage.Content = "Radio button 1 is checked.";        }          //This event is fired when user checked second radio button        private void rr2_Checked(object sender, RoutedEventArgs e)        {            lblMessage.Content = "Radio button 2 is checked.";        }
```

##### Output of the following code snippet is as follows

![RadioButton Control in WPF](https://www.mindstick.com/mindstickarticle/d6cb1776-e81b-42e6-b3a0-e3403fcb2c90/images/1a03fd23-2ed6-403a-b1fc-b114dccd6918.png)

Whenever any user checked any radiobutton then message is displayed on label that radiobutton 1 is checked or radiobutton 2 is checked.

![RadioButton Control in WPF](https://www.mindstick.com/mindstickarticle/d6cb1776-e81b-42e6-b3a0-e3403fcb2c90/images/f3e11b82-c78c-421b-8ab6-5a7786ceb3c3.png)

![RadioButton Control in WPF](https://www.mindstick.com/mindstickarticle/d6cb1776-e81b-42e6-b3a0-e3403fcb2c90/images/08cf81b2-7d3c-4a99-b512-2d3edbac3429.png)

---

Original Source: https://www.mindstick.com/articles/522/radiobutton-control-in-wpf

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
