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
1483
Programatically created dockareas are forgetful
posted

Hi,

 I programatically create a tabbed dockable group pane with 2 tabs.  After these tabs are created and displayed. I grab a tab and float it.  Once floated I double click on the floated dock in order to send it back from where it came.  When it returns to the dock it returns to a new group not from the tab group.  If I manually put it back into the correct tab group then perform the same float and dock operation all is well.  Is there something I can do when manually creating a tab group to have the panes remember where they came from when floated?  Heres my code to create Groups and Panes:

protected static DockableGroupPane CreateTabDockableGroupPane(IControlDefinition definition)

{

DockableGroupPane dockGroupPane = new DockableGroupPane();dockGroupPane.ChildPaneStyle = ChildPaneStyle.TabGroup;

dockGroupPane.GroupSettings.TabLocation = ConvertToLocation(definition.TabOrientation);

dockGroupPane.Size =
new Size(definition.Width, definition.Height);

dockGroupPane.Text = definition.Name;

return (dockGroupPane);

}

 

protected virtual void AddControlToGroup(DockableGroupPane groupPane, IControlDefinition definition)

{

if (definition != null)

{

DockableControlPane dockableControlPane = new DockableControlPane();

dockableControlPane.OriginalControlBounds = new Rectangle(definition.X, definition.Y, definition.Width, definition.Height);

dockableControlPane.Size = new Size(definition.Width, definition.Height); Control control = CreateControl(definition);

dockableControlPane.Control = control;

dockableControlPane.Text = definition.Name;

groupPane.Panes.AddRange(
new DockablePaneBase[ { dockableControlPane });

}

}

 

Thanks,

Bill