I have a solution in Visual Studio 2013 which contains two Forms. I want when a button pressing in Form2, the variable flag_fb is updated and I use its value in For
Something like this should also work.
// Open form2 from form1
using (Form2 form2 = new Form2())
{
if (form2.ShowDialog() == DialogResult.OK)
{
m_myVal = form2.flag_fb;
}
}
You should make sure flag_fb is public member variable of Form2, and
also make sure it is set to desired value when user clicks OK for instance.