MDIWorkspace the second :-) this time docking

Topics: CAB & Smart Client Software Factory
Oct 18, 2005 at 11:57 PM
originally posted by: cpiock

i have seen that if i make a application with a mdi workspace the usercontrols in my module woldn't be docked as fill? its this a bug or is this correct so and i must make the docking manually?

//MDIWokSpace Class Show code:
public override void Show(object smartPart, ISmartPartInfo smartPartInfo)
{
Control spcontrol = WorkspaceUtilities.GetSmartPartControl(smartPart);
Form mdiChild = this.CreateForm(spcontrol);
mdiChild.MdiParent = parentMdiForm;

this.SetWindowProperties(mdiChild, smartPartInfo);
mdiChild.Show();
this.SetWindowLocation(mdiChild, smartPartInfo as WindowSmartPartInfo);
mdiChild.BringToFront();
}
Oct 19, 2005 at 11:17 PM
originally posted by: cpiock

Here my work around for who is interested, if you have other better solution please post thx:

public class SIAGMDIWorkSpace : Microsoft.Practices.CompositeUI.WinForms.MdiWorkspace
{
public SIAGMDIWorkSpace(Form parentForm)
: base(parentForm)
{
}

public override void Show(object smartPart, ISmartPartInfo smartPartInfo)
{
Control spcontrol = Microsoft.Practices.CompositeUI.WinForms.WorkspaceUtilities.GetSmartPartControl(smartPart);
Form mdiChild = this.CreateForm(spcontrol);
spcontrol.Dock = DockStyle.Fill;
mdiChild.MdiParent = this.ParentMdiForm;


this.SetWindowProperties(mdiChild, smartPartInfo);
mdiChild.Show();
this.SetWindowLocation(mdiChild, smartPartInfo as Microsoft.Practices.CompositeUI.WinForms.WindowSmartPartInfo);
mdiChild.BringToFront();
}
}