Hi,
I'm working with dockable Winforms using UltraDockManager, I have seen that it's possible to disable the "Hide" context menu item (x.DefaultPaneSettings.AllowClose = DefaultableBoolean.False) but it's possible also to remove completely the "Hide" menu item from the context menu ?
Regards
Hi Christian,
Thank you for posting in our forums.
Currently the ContextMenu of the UltraDockManager is not publicly exposed so you can’t remove items directly from it. What you could do is to get it when the user clicks on the pane caption. In order to do that subscribe to the MouseEnterElement and MouseLeaveElement events of the UltraDockManger. In the MouseEneterElement event if the user has entered an element of type PaneCaptionUIElement subscribe to the MouseDown event of its Control. In the MouseLeaveElement unsubscribe to this event. Then in the MouseDown event you can access the context menu directly form the ContextMenu property of the sender. However its items won’t be populated at that time so we need to subtribe to the context menu’s Popup event. In the Popup event the items will be populated so we can easily remove the hide item.
I have attached a small sample which demonstrates this approach.
Please let me know if you have any additional questions.
Hi Dimitar,
Thank you for the solution.I'll try and I'll keep you posted.
I tried the solution you proposed ant it works now perfectly !Thank you very much for your help !Regards