Hi everyone, in WinToolbars there is a ControlContainerTool which you can add a windows form to it. Now in WinToolbars there are two methods to save and load tool/ribbon/toolbars confiuration. I have added a few ControlContainerTools with NumericUpDown winform tool but when I load the xml file it does not load the embeded tool. Does anyone know if this is supposed to happened or WinToolbars does not save any winform controls for the property of ControlContainerTools same for for PopupControlContainerTool?? Thanks in advance ,Jose
It should load them correctly assuming you have the Name properties of each contained control set to a unique value at the time of saving. If they have their same name's and are in the Form's Controls collection at the time of load, all controls should be loaded correctly.
Well I do set the contained controls name property but I create the controls at runtime but do not add the controls to the form's controls collection...well for me I have them in a usercontrol. The reason why I wanted to save the wintoolbars tools was because I want to load them at runtime when the form has no controls at all.
The controls which belong to control container tools must be controls on the toolbars manager's DockWithinContainer when you load the layout. The controls can either be directly on the Form or UserControl or within some child control of it. You can load the layout in the constructor after the call to InitializeComponent and that will prevent you from seeing the controls on the UserControl when it is finally shown.
However, if you mean that the controls are not available to you at the time you load the layout, but you still want those tools loaded correctly, you can probably put placeholder controls on the UserControl with the same names as the tools which were saved. When the correct control becomes available, set it as the Control property on the appropriate ControlContainerTool. When you set this, I believe the placeholder control you were using will be added back to the UserControl, so you will probably want to remove it from the UserControl at this point. Because of this, you might also want to set the back color of these placeholders controls to Transparent so you don't see it flicker on screen.