Hi all
I am developing a form with a toggle button in the toolstrip ... i have given the property checkonclick to true and gave this coding in the click event....
I am loading a Groups (Usercontrol) in the MainPanel1 (panel)....
It works for first time but does not work again for the second time... am i doing any thing wrong or is there any other code for this....
Please help me...
int groupsPanel = 0;
Groups groups = new Groups();
private void Group_toolStripButton_Click(object sender, EventArgs e)
{
if (groupsPanel == 0)
{
groupsPanel = 1;
MainPanel1.Controls.Add(groups);
groups.Dock = DockStyle.Left;
}
else if (groupsPanel == 1)
{
groupsPanel = 0;
groups.Hide();
}
}
Thanks
vince