Hi,
We dynamically change context-menu contents in BeforeToolDropdown event. The menu has complex structure with sub-menus. Everything work fine until the form is not tabbed to UltraTabbedMdiManager. When the form is tabbed, after closing one of the sub-menus whole context menu is closing too.
What we should do to prevent this? Thanks in advance.
Hello.
Do you have any sample code that you could provide or could yopu give us more details about your application?
Hello,
Yes, we have sample code (find attached). Use case is:
1. After application start you will see main form with two child forms attached to right and left edge of main form. Context menus for both of child forms work well .
2. Then undock one of these child forms and put it inside the main form (i.e. Mdi). Context menu under this docked inside form work well. But the context menu under the form that is still docked at one of the edges is broken.
I downloaded and tested the sample that you provided and I can't see anything wrong with it. I can see the context menu for both docked windows when the application starts. Then, I can undock either window and then re-dock them anywhere (top, left, left right, or have them fill the whole form so that the tab appears) and I can see the context menu for both windows. I can even undock either window and leave them floating and I can still see the context menu for each form.
I am trying to run this application so that if I undock one window and then either leave it floating or re-dock it somewhere else I can see the context menu for the window I just undocked and then re-docked, but I can't see the context menu for the other window which has not been undocked at all. Regardless of how I dock or undock these windows I am still able to see the context menu when I right click on each pane. Do you have a video of what you are doing that you could attach? That would make it easier for me to see what's going on.
I'm sorry, but I don't see any difference in the way that the left and right context menus are working. In the video you can see that the context menu is the same for both child windows. When I run the sample application I see the same results. The context menu contains the same number of menu items with the same captions for both child windows regardless if they are docked to the sides of the form or if they are set to take up the remaining space as an MDI child form.
What is the negative behavior that you are referring to?
The contents of menus is OK and that is not what I'm referring to. At the beginning of the video (0:00-0:10) you can see how I open menu. And that is good behaviour. First menu item with subitem opens. When I move the cursor from the first menu item to the second, the submenu is closed, but context menu remains opened.
Bad behaviour begin with context menu of left pane at (0:25-0:30) after I tabed right pane . First menu item with subitem opens. But when I move cursor to the second, the submenu is closed and closes whole context menu without my additional actions. That's what I don't like.
Now I see what you are talking about; please forgive me for not seeing this before and having this take more time than necessary. This looks like a bug and I will forward this on to our Developer Support department so that they can create a case and log it with development so that we can look into it further.
Stanislav,
Our developers recommend that you add UserControls to the docked panes rather than Forms. That should resolve the issue of the ContextMenu closing when it should not.
Michael S.
I will submit this as a development issue. You will receive more information through the support case.