tylerl tylerl - 1 year ago 119
C# Question

Handling right-click within a MenuItem

Is it possible to check for a right-click on a menu item in .NET?

It appears that the framework doesn't expose it as an Event, but I've seen other applications (like Chrome and Firefox) which allow you to bring up a right-click context menu for a menu item. Presumably with a little event-loop magic you can do the same thing in .NET, right?

EDIT: I'm talking about desktop application programming, not ASP.NET.

Answer Source

It is an unnatural act. Menus are designed to automatically pop down when they lose the focus. The context menu will take the focus, end of menu. MenuStrip will fight you tooth and nail, I haven't seen it done.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download