Validating CheckBox in another form

0

Hello, everyone.

Probably my doubt is a little silly, but I did not find much of it on the internet ...

Could you please explain to me how I can call the value of CheckBox to another form?

My idea is to get pre-determined information in the name of checkBox , and play them in the other form, where I can "validate" these strings.

Thanks for the help!

    
asked by anonymous 18.10.2015 / 16:18

1 answer

1

You can create an OK button and an event for when the user clicks on it, if the checkBox has checked, it will put true on a global variable of type Boolean and then just put an If on the other Window to compare

private void button_OK_click(object sender, RoutedEventArgs e)
    {
        if (checkBox.IsChecked == true) 
            MainWindow.Global.pergunta1 = true;
     }
    
22.10.2015 / 23:27