hi everyone, could anyone tell me how can i change my menustrip from menustrip1 to menustrip2. Well i have 2 forms, Form1 and Form2, in Form1 i have 2 menustrips menu1 & menu2. Once i click menu1, my form2 will show with a listview, so my form1 and form2 now is in display, and now what i want to happen is when i click an item in listview in form2, my menustrip in form1 will change from menu1 to menu2, but whats happening to my form is it does change from menu1 to menu2, but my problem is my form1 must change from enable to disable before it changes its menu. how can i do this without changing the form1 status, like it was always ENABLE. thank you for your replies...
heres my code:
FORM1(2 menustrip menu1 & menu2)
private void Form1_Load(object sender, EventArgs e)
{
menuStrip1.Show();
menuStrip2.Hide();
}
private void hiToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Enabled = false;
Form2 form2 = new Form2();
form2.InstanceRef = this;
form2.Show();
}
private void menuStrip1_EnabledChanged(object sender, EventArgs e)
{
menuStrip1.Hide();
menuStrip2.Show();
}
FORM2(listview)
private void Form2_Load(object sender, EventArgs e)
{
listView1.View = View.List;
listView1.Items.Add("1");
listView1.Items.Add("2");
}
private Form m_InstanceRef = null;
public Form InstanceRef
{
get{return m_InstanceRef;}
set{m_InstanceRef = value;}
}
private void Form2_FormClosed(object sender, FormClosedEventArgs e)
{
InstanceRef.Enabled = true;
}
private void listView1_Click(object sender, EventArgs e)
{
InstanceRef.Enabled = true;
}