Click here to Skip to main content
12,634,030 members (24,948 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# Windows form
I have disabled the Tool-strip in the main form when i loaded the new pop up.

//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.

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


what might be the problem...
Posted 11-Feb-13 23:55pm
Velrats1.3K

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Hi,
Please check the below code,
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
  Permalink  
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161208.2 | Last Updated 12 Feb 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100