0

i have a StackPanel, which contain radio button, i want to access the value of the radio button at runtime, how can i get the radio button value, i am total newbie in WPF, any helps?

<StackPanel Height="73" HorizontalAlignment="Left" Margin="105,78,0,0" Name="stackPanel1" VerticalAlignment="Top" Width="200" >
    <RadioButton Content="Button1" Height="16" Name="radioButton1" Margin="10" />
    <RadioButton Content="Button2" Height="16" Name="radioButton2" Margin="10" />
</StackPanel>
Luke Woodward
  • 63,336
  • 16
  • 89
  • 104
Abbas
  • 4,948
  • 31
  • 95
  • 161
  • If you are a *"total newbie"* you should not be here, but [someplace with documentation](http://msdn.microsoft.com/en-us/library/aa970268.aspx). – H.B. Feb 07 '12 at 22:14
  • Abbas, I can highly recommend Windows Presentation Foundation Unleashed by Adam Nathan. If you spent just 3-4 hours with that very simple, very well written book, you would be way past the need to ask questions like this. – Ed Bayiates Feb 07 '12 at 22:21

1 Answers1

0

Use radioButton1.IsChecked from the codebehind.

demoncodemonkey
  • 11,730
  • 10
  • 61
  • 103