Windows Develop Bookmark and Share   
 index > Windows Forms General > How do I add an item to the caption bar context menu?
 

How do I add an item to the caption bar context menu?

Hi,

How do I add an item to the context menu displayed when you right-click on the caption/title bar.

The current items are:

Restore
Move
Size
Minimize
Maximize
---------
Close

What I would like to do is add an item below the "Close" option called "About..." that will display the application's about dialog. I know how to add a context menu to the form but I am having difficulty in getting hold of the above caption bar context menu.

Any help in this matter would be highly appreciated

Regards
Gareth
GvanderMerwe  Tuesday, November 15, 2005 6:50 AM
I'm not sure at all about that but I think the windows forms framework doesn't allow you to do so.

Therefore, it seems that you would need to make use of win32 API if you really want to do so using Interop.
Amadrias  Tuesday, November 15, 2005 9:40 AM
I'm not sure at all about that but I think the windows forms framework doesn't allow you to do so.

Therefore, it seems that you would need to make use of win32 API if you really want to do so using Interop.
Amadrias  Tuesday, November 15, 2005 9:40 AM
Thanks for the reply......

I did some more research based on your answer and it does seem indeed that the only way you can manipulate the system menu is to use the win32 API. If anybody is interesed they can search for "c# and "GetSystemMenu" in google otherwise you can refer to the following article:

http://www.codeguru.com/Csharp/Csharp/cs_misc/userinterface/article.php/c9327/

Thanks again
Gareth
GvanderMerwe  Tuesday, November 15, 2005 10:57 AM
You'll find a similar example on my site in both C# and VB.net.

http://www.dotnetrix.co.uk/menus.html
Mick Doherty  Tuesday, November 15, 2005 6:52 PM

You can use google to search for other answers

Custom Search

More Threads

• Working with multiple query strings in control
• bind DataRow[] to a checkedlistbox
• Smooth Edge Form VB.NET
• lstguess.Items.Remove problem
• SETUP Forcing desktop short to All Users
• UserControl Custom Events
• DataGridView add rows
• Regarding DataGrid
• Walkthrough of new Layout Properties
• Colour in the data grid