Hi!
I have a top form with a toolbar Manager and below that mdi-forms.All MDI-Forms share similar Tools on the toolbar.Most of the Tools are button-Tools.Under some of this button-Tools there ar submenueitems.
This works fine as Long as the keys of the button-Tools are different.
If I have a button tol bDetails on more thant one toolbar the merging does not work anymore.The first MDI-Form has the correct System.Windows.Forms.ToolStripMenuItemsThe second MDI-Form gets the correct ToolStipMenuItems.
But when I now Change back to the first MDI-Form the bDetails Button-Tool Shows the same Menuitems as the second MDI
the Mergetypes are set to Replace. What I am doing wrong? Or does this not work with submenuitems?
TIA
Josef
Hi Josef,
What Infragistics controls are you using in your application? Are you using UltraToolbarsManager?System.Windows.Forms.ToolStripMenuItems is a Microsoft class an could point to an issue in .NET.
Are you able to provide a sample application that we can use to debug?
Yes I am using UltraToolbarmanager.
Unfortunatelly this is an OpenEdge Application so you most probably will not be able to debug it. (and ist quite a few classes)
Is there an Infragistics eqivalent for ToolstripMenuitem which I could use?
You can use our PopupMenuTool in place of your ToolstripMenu. Please see this page for details on how to use the PopupMenuTool:http://help.infragistics.com/doc/WinForms/2016.1/CLR4.0/?page=WinToolbarsManager_Add_a_PopupMenu_Tool_to_a_Toolbar.html
If I am understanding correctly, the behavior is correct when the button tools have different keys. Is it possible to change the keys so that there is no conflict?
Looks like my last reply was not posted.
Well the keys of the button-Tools are equal like bDetails and bDetails. If I understood the documentation correctly this should not be a Problem.
Anyway I did more tests in the meantime.
I rebuilt the Submenues on the form_activate Event - but still do not see any Change.
I clear the submenues from all button Tools and rebuild them but still nothing changes. The last added submenues stay on all MDI-Forms although the Top menue gets merged correctly (like before).
And yes the behaviour is correct for button Tools which have different keys.
Any Ideas how I can manually Change the Menuitems after Merging? I could not find an Event which might be usefull.
Regards
I'm working to reproduce this scenario in a small sample, but have not yet been successful. In the sample, I set up a main form with two child forms. The main form and the child forms each have ToolbarsManagers with a standard toolbar and different buttons on them. The child forms both have a "bDetails" tool. I wasn't sure how you were displaying the submenus, so I used a PopupMenuTool and added three buttons to each. The child forms both have a bDetails tool, but the menus are different.
In the sample, the toolbars seemed to merge with no issues. I always saw the correct menu for the active child form. I have attached my sample here. Would you be able to modify it so that the issue occurs? Alternatively, you can send me a new sample and I'll work with that.
We normally use the main form's MdiChildActivate event to respond to toolbar merging. You can handle this event and perform any necessary processing immediately after merging occurs. If you need to take any actions directly before a merge, you can override the OnMdiChildMerge method in the parent form's class and add code before the base call. I added some comments to the sample at these locations for convenience.
Please let me know if you have any questions.
Hi Mike
Your are a great help for my Problem.
I changed to a PopupMenutool and the merging works fine now beetween the MDI-Forms.
I have only a small issue now.
The Button is a segmentedStateButton - so that I can click on it and get the click Event. If I click at the small arrow I get my Drop-downs and I can use them.
What I would like to add is a right-mouse click to open the Submenue because the Arrow is so small, that quite a few of my customers will have Trouble clicking on it.
We had the right mouse already in use. How can I do that.
Again many thanks for your professional help.
You can accomplish this by handling BeforeToolbarListDropdown. In this event, you can check to see if the user right clicked that particular popup tool. If so, cancel the regular context menu and call DropDown on the tool.
private void ultraToolbarsManager1_BeforeToolbarListDropdown(object sender, BeforeToolbarListDropdownEventArgs e){ if (e.Tool.Key == "PopupMenuTool1") { e.Cancel = true; (e.Tool as PopupMenuTool).DropDown(); }}
Please let me know if this works for you.
HI!
Perfect - Thank you very much.