How do I get this to work? I'm dynamically adding a UserControl to the Dock control, and I can't seem to get the docked window to get scrollbars to show up when it is resized.
CSUserControl is simply a wrapper around the standard UserControl that gives me some extra functionality.
I've gotten it SORT OF working by using the commented out lines above - when I set the TabStrip AutoScroll = true and the minimum size as well, then the scrollbars show up. BUT it's terrible in implementation - the tabstrip randomly disappears or repeats itself, scrollbars show up when they're not supposed to be, scrolling around wrecks the tabstrib.
How am I supposed to be doing this?
CSUserControl itemControl; |
if (typeof(CSUserControl).IsAssignableFrom(ucType)) |
{ |
itemControl = (CSUserControl) Activator.CreateInstance(ucType, parameterList); |
} |
else |
{ |
UserControl item = (UserControl)Activator.CreateInstance(ucType, parameterList); |
itemControl = new CSUserControl(); |
itemControl.Controls.Add(item); |
item.Dock = DockStyle.Fill; |
} |
Size size = itemControl.Size; |
//Hook up events |
itemControl.WindowChangeRequested += documentPane_WindowChangeRequested; |
itemControl.WindowOpenRequested += documentPane_WindowOpenRequested; |
itemControl.WindowCloseRequested += documentPane_WindowCloseRequested; |
itemControl.AutoScroll = true; |
HostWindow host; |
if (dockPosition == DockPosition.Fill) |
{ |
host = _dock.DockControl(itemControl, dockPosition, DockType.Document); |
} |
else |
{ |
host = _dock.DockControl(itemControl, dockPosition); |
} |
host.Text = documentName; |
host.Name = documentName; |
host.CloseAction = DockWindowCloseAction.CloseAndDispose; |
host.AutoScroll = true; |
host.TabStrip.AutoScroll = true; |
//host.TabStrip.MinimumSize = itemControl.MinimumSize; |
//host.MinimumSize = itemControl.MinimumSize; |
DockTabStrip strip = (DockTabStrip)host.TabStrip; |
strip.SizeInfo.AbsoluteSize = size; |
_dock.ActivateWindow(host); |
CSUserControl is simply a wrapper around the standard UserControl that gives me some extra functionality.
I've gotten it SORT OF working by using the commented out lines above - when I set the TabStrip AutoScroll = true and the minimum size as well, then the scrollbars show up. BUT it's terrible in implementation - the tabstrip randomly disappears or repeats itself, scrollbars show up when they're not supposed to be, scrolling around wrecks the tabstrib.
How am I supposed to be doing this?