Please tell me how to apply the defaultcontextmenu of the ultradockmanager functionalities, through code
I need to create a custom context menu with ultradockmanager, I need to add Hide, Floating, Autohide, Close etc in the custom contextmenu.
I have created a contextmenu, but unable to achieve this built in functionality.
Looking forward for your reply
Hello Jeni,
Maybe one possible solution could be:
1. The fist step will be to disable default context menu through property: UseDefaultContextMenus = False
2. The second step is to handle both events : MouseEnterElement and MouseLeaveElement and implement the code below:
private void ultraDockManager1_MouseEnterElement(object sender, Infragistics.Win.UIElementEventArgs e)
{
if (e.Element is TabItemUIElement)
e.Element.Control.MouseDown +=new MouseEventHandler(this.OnControlMouseDown);
}
private void ultraDockManager1_MouseLeaveElement(object sender, Infragistics.Win.UIElementEventArgs e)
e.Element.Control.MouseDown -=new MouseEventHandler(this.OnControlMouseDown);
private void OnControlMouseDown(object sender, MouseEventArgs e)
if (e.Button == MouseButtons.Right)
ContextMenu menu = new ContextMenu();
menu.MenuItems.Add("Test1");
menu.MenuItems.Add("Test2");
((Control)sender).ContextMenu = menu;
By this way the final result will be (see attached screenshot)
Let me know if you have any questions.
Regards