Checkbox validation in another form

Asked

Viewed 222 times

0

Hello, everybody.

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

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

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

Thanks for the help!

  • 3

    She is not silly, but she is also not explained right. Show what you are trying to say, give details of the problems, where you are going, etc.

  • This project is web, right? It’s Web Forms or ASP.NET MVC?

  • No, the project is local Desktop. In fact it is a "game" in the form of text for Informatics.

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 in a global variable of the boleano type and then just put an If in the other Window to compare

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.