2
I have very cute Form1 with very cool button and inside it I have a toggle button on-off. I have another class.Cs and I have a condition in it, but it will only perform if that boot there on Form1 is on. follow on Form1.Cs:
private void metroToggle1_CheckedChanged(object sender, EventArgs e)
{
// caso ligado retorna true ou false algo do tipo
}
My other class.Cs
if(form1.botao = true ou retorna 0 ou 1){
// faz alguma coisa
}
I hope you have understood my question I’m beginner in c# it seems simple for those who have more experience to me ta osso =/. Please in advance for help.
Cesar, your question is confused. How is this class used? the class does not run out of nowhere, or is another form?
– Alexandre Soares Machado
You are inverting dependencies. The class should be used in the form, not the other way around.
– Jéf Bueno
Kind in have only the pure form.Cs with only the visual part and the buttons on and off, and created another class separate form, where in fact has the actions or what will be done, but will only be done if there in my form the button is turned on, That’s my other class has to know when my form boot was turned on to perform something. I thought something like pass a variable that returns if there in the form the button was turned on and that other class receive this value from the button.
– Cesar Augusto