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
314
UltraToolbar as user control?
posted

Hi!

The way Windows Forms with the wysiwyg designer works, it is very easy and tempting to construct GUIs by just dropping basic controls on the designer. This, and the associated handling of these controls, can however easily lead to hard-to-handle code with thousands of lines of code in each of the GUI files.
In order to achieve re-usability and more manageable code I strive to break things up into smaller classes in files of their own (with for instance derived controls and user controls). A simple step is for example to put the specific controls for a tab page in separate class.

We're using the UltraToolbarsManager and I figured putting the different toolbars with their buttons in separate classes with their associated code would be an excellent step to not blog down the main window with code that could live elsewhere. Trying to understand the workings of the UltraToolbarsManager I really can't see how to do this.
I also get puzzled of things such as the DockWithinContainer property, and why the toolbar buttons have to be registered with the UltraToolbarsManager (at all! and) before they are registered with their toolbars.
(I'm suspecting the reason for the latter is related to having the ability to move buttons between different toolbars. The documentation is however not exactly overwhelming on explaining this and the usage of the UltraToolbarsManager.)

So, could anyone give suggestions on how to not blog down the code of a form (such as the main window) with the workings of a toolbarmanager and its toolbars?

Maybe the solution is to put the whole UltraToolbarsManager in a separate user control? But that destructs the DockWithinContainer property construction, right?

We are using Infragistics 10.1 on Visual Studio 2010 and code in VB.Net.

Thanks!
 -Ulf