Posted 18 years ago
by Thierry Bouchard
Hi,
my application supports the creation of dynamic toolbars via a plugin system. The problem is that even if I activate a dynamic toolbar, it doesn't display.
I noticed that when calling the BarManager EndInit method in the InilializeComponent method of my form, some calculations are made to set the BodyBounds property of the dockable toolbars, which is essential for them to be displayed. In my case, the initialization of dynamic toolbars is made after the InitializeComponent method, so the BodyBounds is never calculated.
So I tried various things, like calling the BeginInit and EndInit method before adding a toolbar to the BarManager, which seems to work. I also tried just setting the Active property of a dockable toolbar to false and then to true, which forces a recalculation of the BodyBounds property. But all these workarounds semms a little ugly and furthermore, the recalculation decides to place the toolbar at a different position than it was intended to be placed. For example I wanted to place my toolbar at row 0 column 3, which is completely valid, but the recalculation decides that my toolbar will appear on row 1.
So my question is, is there a normal and clean way to have a toolbar created dynamically to be displayed properly or do I have to make one of those workaround? If so, how can I have my dynamic toolbar to remain at the position it was supposed to be placed?
Thx
my application supports the creation of dynamic toolbars via a plugin system. The problem is that even if I activate a dynamic toolbar, it doesn't display.
I noticed that when calling the BarManager EndInit method in the InilializeComponent method of my form, some calculations are made to set the BodyBounds property of the dockable toolbars, which is essential for them to be displayed. In my case, the initialization of dynamic toolbars is made after the InitializeComponent method, so the BodyBounds is never calculated.
So I tried various things, like calling the BeginInit and EndInit method before adding a toolbar to the BarManager, which seems to work. I also tried just setting the Active property of a dockable toolbar to false and then to true, which forces a recalculation of the BodyBounds property. But all these workarounds semms a little ugly and furthermore, the recalculation decides to place the toolbar at a different position than it was intended to be placed. For example I wanted to place my toolbar at row 0 column 3, which is completely valid, but the recalculation decides that my toolbar will appear on row 1.
So my question is, is there a normal and clean way to have a toolbar created dynamically to be displayed properly or do I have to make one of those workaround? If so, how can I have my dynamic toolbar to remain at the position it was supposed to be placed?
Thx