Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

16. WPF Controls > Radio Button Groups

Radio Button Groups

If you look back to the partial class diagram of the RadioButton on page 565, you’ll see that the class adds only one property to the ToggleButton from which it descends: GroupName, which is defined as a String. Unlike other types of buttons that operate independently, RadioButtons interact within a group—only one button in the group can be selected at any given time.

There are two ways to create a RadioButton group. You can either nest them in the same container (usually, but not always a GroupBox), or you can explicitly assign the GroupName property to the same value.


Put on Your Thinking Hat

image

Re-create this window, using any image you like. When you do, and you run it, test the behavior of the RadioButton and CheckBox objects. Both of them are in StackPanels inside a GroupBox, but they behave differently. How?


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


 Â