Hephaestus
New member
- Joined
- Apr 18, 2018
- Messages
- 1
- Programming Experience
- 1-3
Alright, after searching the internet for a good day I give up.
Here is what I have as XAML:
However when I try to do this:
I have red squiglies under "RadioButton1" and "RadioButton2"
After changing the x:name multiple times and resetting there name, nothing happens.
Is it maybe because I can't access radiobuttons from the code-behind then main page?
Do I need to be in the code-behind the radiobuttons?
Here is what I have as XAML:
C#:
<RadioButton x:Name="RadioButton1" Content="Hello" HorizontalAlignment="Left" Margin="225,190,0,0" VerticalAlignment="Top"/>
<RadioButton x:Name="RadioButton2" Content="Goodbye" HorizontalAlignment="Left" Margin="500,190,0,0" VerticalAlignment="Top"/>
However when I try to do this:
C#:
if (RadioButton1.IsChecked == true) {
MessageBox.Show("Hello.");
}
else
{
RadioButton2.IsChecked = true;
MessageBox.Show("Goodbye.");
}
I have red squiglies under "RadioButton1" and "RadioButton2"
After changing the x:name multiple times and resetting there name, nothing happens.
Is it maybe because I can't access radiobuttons from the code-behind then main page?
Do I need to be in the code-behind the radiobuttons?