Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
195
Enumerate through ToolBars
posted

I want to enumerate through toolbars, I have an MDI application that I will have various windows in, and I want to make a menu item for "Window".  I already have the Cascade, Horizontal, etc.  What I want to do is build a menu of the applications that are running in the MDI container in the menu.  To do this I need to manipulate the toolbar in the MdiChildActivate event I believe, essentially going through all MDI windows that are open, and creating a menu item for ones that are created or delete menu items for the ones they just closed. 

Anyone have any ideas?  Perhaps I am going about this the wrong way as well. 

Something like:

foreach (Tool tc in this.ultraToolbarsManager1.Toolbars["Window"].Tools) {
     if this TC exists, delete it if it's closing, else add a menu item and a spacer at the end between the new windows and the cascade, horizontal, etc. functions.
 }

 I have an idea of using the this.ultraToolbarsManager1.Toolbars["Window"].Tools.Count and using it in a "for (i ++)" type loop instead, but just wanted to throw this out to see what the thoughts are on the best way to accomplish this with the ultraToolbarsManager is.

Thanks ahead of time for any assistance.