All I am trying to do is to change the state of checkbox on form2, and keep the state after pression OK. I have form1 which is my main form and it only has one Strip menu. The code for form1 is as follow:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void dialogToolStripMenuItem_Click(object sender, EventArgs e)
{
Form2 dialog = new Form2();
dialog.ShowDialog();
}
}
}
The Form2 only has one checkbox and one OK button.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace test
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void OK_Click(object sender, EventArgs e)
{
if (cbxForm2.Checked == true)
{
cbxForm2.Checked = true;
}
}
}
}
How can I change my code so when I go back on the menu the state of the combo box is as I left it?