Posted 20 years ago
by Crispin Horsfield
-
Software developer,
Caz Limited

I'm sure this should be easy...
At runtime I want to set the width of a ToolWindow to correspond to the design-time width of a UserControl ie when the ToolWindow is created anew, the width of the ToolWindow that contains the control is assigned a particular value. That way the user gets to see the whole control by default - whether they chose to hide a bit of it later is up to them.
This code isn't working as intended:I've tried various combinations to no avail and it's not appropriate (in this instance) to save the whole layout. This ToolWindow will only be used once in a while, so I destroy it before saving the layout of the other ToolWindows on application close.
Any help would be appreciated.
Crispin
At runtime I want to set the width of a ToolWindow to correspond to the design-time width of a UserControl ie when the ToolWindow is created anew, the width of the ToolWindow that contains the control is assigned a particular value. That way the user gets to see the whole control by default - whether they chose to hide a bit of it later is up to them.
This code isn't working as intended:
Dim objChildControl As New MyUserControl()
_twToolWindow = New ToolWindow(ctlDockManager, "MyUserControl", "My User Control", -1, objChildControl)
With _twToolWindow
.DockTo(ctlDockManager, DockOperationType.LeftOuter)
.Width = 350
End With
Any help would be appreciated.
Crispin