C# top menu, toolstripmenuitem, how to stop closing as I need to check several option

C#, VS2015. related to top menu where I have several toolstripmenuitem with list of option that I like to check thro, but I need to stop autohide.
I could not find closing event which enable to cancel closing. I do not see autohide to set false in property.

Please provide C# code example how to keep menu from closing, while checking until I finish with it (by clicking outside the pull down menu or escape key)
Richard PayneChief Technology EngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jacques Bourgeois (James Burger)PresidentCommented:
The event to stop the form closing is on the Form and is called FormClosing.

You can validate your informations in there, and if there is a problem, simply set the e.Cancel parameter to True to prevent the form going on with the closing operation.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Richard PayneChief Technology EngineerAuthor Commented:
There is no formclosing in the list of the properties on pulled down menu item, it missing.  It just has formclosed.

R.
Richard PayneChief Technology EngineerAuthor Commented:
This is MenuStrip object
Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

Richard PayneChief Technology EngineerAuthor Commented:
It has DropItemClosed but no DropItemClosing event.
WilliamCommented:
If you add these events to your code - you can keep the menu open till the mouse leaves:

  bool MouseIn = false;

        private void contextMenuStrip1_Closing( object sender , ToolStripDropDownClosingEventArgs e )
        {
            if ( MouseIn )
            {
                e.Cancel = true;
                return;
            }
                
        }

        private void contextMenuStrip1_MouseEnter( object sender , EventArgs e )
        {
            MouseIn = true;
        }

        private void contextMenuStrip1_MouseLeave( object sender , EventArgs e )
        {
            MouseIn = false;
        }

Open in new window

Richard PayneChief Technology EngineerAuthor Commented:
Wiliams

Thank for reply but there is no closing properties for that menulist..
WilliamCommented:
Please post the code that creates the object you are referring to, this will let us know the type of control you are using. As "menulist" is not a control.
Richard PayneChief Technology EngineerAuthor Commented:
Thank for trying no solution, so I took other way,  but grateful for your response.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.