I have several GroupBox
controls, and all but one work fine. Code is the same, I don't see what the problem might be. I get NullReferenceException
. Does anyone have any clue? This is XAML:
<GroupBox Header="Load neural network" Height="90" HorizontalAlignment="Left" Margin="416,34,0,0" Name="groupBox3" VerticalAlignment="Top" Width="207" IsEnabled="False">
<Grid>
<Button Content="Load" Height="23" HorizontalAlignment="Left" Margin="114,32,0,0" Name="loadBTN" VerticalAlignment="Top" Width="75" />
<TextBox Height="23" HorizontalAlignment="Left" Margin="6,32,0,0" Name="textBox1" VerticalAlignment="Top" Width="93" />
</Grid>
</GroupBox>
And this is code behind where error pops up:
private void loadRBcheck_Checked(object sender, RoutedEventArgs e)
{
newRBcheck.IsChecked = false;
groupBox1.IsEnabled = false;
groupBox2.IsEnabled = false;
inputTB.IsEnabled = false;
hiddenTB.IsEnabled = false;
outputTB.IsEnabled = false;
groupBox3.IsEnabled = true; //this line causes error
label1.IsEnabled = false;
label2.IsEnabled = false;
label3.IsEnabled = false;
}