I'm using WinForms. I have 2 Forms, Form1 (Main Form) and Form2. I have 2 variables in Form1 which is Computer_Selected
and Default_Selected
. I change one of the variable when i click on a button in Form1 and then show Form2. In Form2 i want to know the variables bool value. How can I do this?
Form 1
public bool Computer_Selected;
public bool Default_Selected;
private void btn_Public_Kiosk_Click(object sender, EventArgs e)
{
Computer_Selected= true;
Default_Selected = false;
//show form2 and hide this form-(form1)...
}
Form 2
private void Form1_Load(object sender, EventArgs e)
{
Console.WriteLine("Bool Value = " + Computer_Selected);
}