Click here to Skip to main content
15,886,673 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have disabled the Tool-strip in the main form when i loaded the new pop up.

C#
//during disabling the main form
this.Cursor = Cursors.WaitCursor; // changed the way the cursor looks

for (int ItemCounter = 0; ItemCounter < toolStrip1.Items.Count; ItemCounter++)
{
          toolStrip1.Items[ItemCounter].Enabled = false;
}


But couldn't revert back the main form to get enabled when the pop up is closed.

C#
this.Cursor = Cursors.Arrow; 
for (int ItemCounter = 0; ItemCounter < toolStrip1.Items.Count; ItemCounter++)
{
          toolStrip1.Items[ItemCounter].Enabled = true;
}


what might be the problem...
Posted

1 solution

Hi,
Please check the below code,
C#
private void contextMenuStrip2_Closed(object sender, ToolStripDropDownClosedEventArgs e)
        {
            this.Cursor = Cursors.Arrow;
            for (int ItemCounter = 0; ItemCounter < toolStrip1.Items.Count; ItemCounter++)
            {
                toolStrip1.Items[ItemCounter].Enabled = true;
            }
        }

        private void contextMenuStrip2_Opened(object sender, EventArgs e)
        {
            //during disabling the main form
            this.Cursor = Cursors.WaitCursor; // changed the way the cursor looks

            for (int ItemCounter = 0; ItemCounter < toolStrip1.Items.Count; ItemCounter++)
            {
                toolStrip1.Items[ItemCounter].Enabled = false;
            }
        }


Best Regards
Muthuraja
 
Share this answer
 
Comments
Velrats 14-Feb-13 5:26am    
Is there any event in that name... contextMenuStrip2_Closed and contextMenuStrip2_Opened... i searched all where but couldn't find... pls help me in locating....
Muthuraja Irullandi 14-Feb-13 10:23am    
hi,
ContextMenuStrip is the popup menu control and opened and closed both are events.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900