Hide some window state menu items

Docking/MDI for Windows Forms Forum

Posted 13 years ago by Slava
Avatar
Hello.

I've got a question on using UIStudio:
There's a triangle button in the corner of ToolWindow. When it's pressed, a menu of available window states appears(Floating, Dockable, Tabbed-document, auto-hide, hide). Some of the items are disabled in this menu. I'd like to hide those disabled items. The question is how to do that?

Thanks in advance!

Comments (5)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
You'd have to implement the menus yourself instead since that is built in functionality. You can handle the WindowContextMenu event and display your own menu and cancel ours. You can use methods like ToolWindow.IsMenuItemEnabled and other similar ones to determine how to display items.


Actipro Software Support

Posted 13 years ago by Slava
Avatar
Thanks!
You clarified the issue.
Posted 13 years ago by Slava
Avatar
And another question about window menu.
Is it possible to disable 'Dockable' menu item for a tabbed document? The tabbed document cannot be docked anywhere, but still menu 'Dockable' is not greyed. When I choose 'Dockable', window docks to left side and cannot be docked anywhere else except it's normal position in the middle.
I would like to have 'Floating', 'Dockable' and 'Auto-hide' disabled for document windows. Only 'Tabbed document' and 'Hide' enabled.

And yet another question: as I understand 'Hide' menu item is controlled only thru CanClose property of a ToolWindow. Is it right?

Thanks!
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
You shouldn't be seeing a Dockable menu item for document windows. In our sample, you will see that document windows only show a Close option and new tab group options. You will see a Dockable menu item for tool windows that are in the MDI area. So it sounds like you are really using a tool window and not a document window in the MDI area. But in that case you will also see all the other options like Floating, etc. for a tool window.

Yes the Hide menu item for tool windows is controlled by CanClose. CanClose also controls whether a document window's Close menu item is enabled.


Actipro Software Support

Posted 13 years ago by Slava
Avatar
You were right! I was using ToolWindow instead DocumentWindow :-)
Now everything's ok.

Thanks again!
The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.