Customizing the Options menu for ToolWindow

Docking/MDI for Windows Forms Forum

Posted 16 years ago by Miriam Kuruvilla
Version: 2.0.99
Avatar

Is there a way to add custom options to the ToolWindow options menu?
For example in addition to {Floating|Dockable|AutoHide|Hide} I would like to add options like Rename and Close. How can I do this?

Comments (4)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Miriam,

Yes, you can process the DockManager.WindowContextMenu event and the default menu is in e.DefaultContextMenu. Other properties tell you why the menu was created. You can fully customize it before it was displayed.


Actipro Software Support

Posted 16 years ago by Miriam Kuruvilla
Avatar
I used the WindowContextMenu event to add a MenuItem to the DefaultContextMenu. It successfully added the new item, but when it is displayed, it looks completely different from the default menus. What do I need to do to create a custom menu item that looks like the default one?

This is the only line of code that i have so far.

e.DefaultContextMenu.MenuItems.Add("Rename", mnuRename_Click);
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
You can use our OwnerDrawMenuItem class and add an instance of that to the menu. That is a regular MenuItem but renders like the others.


Actipro Software Support

Posted 16 years ago by Miriam Kuruvilla
Avatar
Perfect! Thanks a lot!
The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.