Now im coding my first gui program and i have a problem(I know its very simple,but i cant find an answer for it).I have 2 radio buttons,separeted from eachother,and i cant check if radio button is checked ,here`s my code:
<RadioButton Content="Metinės"
Checked="RadioButton_Checked_1"
HorizontalAlignment="Left"
Margin="393,124,0,0"
Height="21"
Width="101"
FontSize="14"
ClickMode="Press"
VerticalAlignment="Top"
FontFamily="Segoe WP Semibold"/>
And c#
if (RadioButton_Checked == true)
{
//program code
}
Give x:Name
or Name
to your RadioButton
like
<RadioButton x:Name="MyRadioButton" Content="Metinės"/>
and then in code behind you can check
if(MyRadioButton.IsChecked == true)
{
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With