Hi,
I'm new to the Infragitics Tools and have a problem. I want to dock a form by the help of the ultradockmanager. Here is my samplecode:
private void btnTest_Click(object sender, EventArgs e) { SuspendLayout(); Form frm = new TestForm1(); frm.TopLevel = false; frm.FormBorderStyle = FormBorderStyle.SizableToolWindow; DockableControlPane dcpForm = new DockableControlPane("form1", "Ein Formular", frm); DockableGroupPane dgpForm = new DockableGroupPane(); dgpForm.ChildPaneStyle = ChildPaneStyle.TabGroup; dgpForm.Panes.Add(dcpForm); DockAreaPane dapLeft = new DockAreaPane(DockedLocation.DockedLeft); dapLeft.Panes.Add(dgpForm); this.ultraDockManager1.DockAreas.Add(dapLeft); ResumeLayout(); }
Where is my fault? The "IsMdiContainer"-property of the (parent-)form ist set to true. Is there an C# sample project for docking forms by the ultradockmanager?
The following is the code snippit that I got working when trying to prove the case. I'm not sure if the show() is entirely necessary, but i did find I had to take care of resizing issues as the panel didn't necessarily manage that itself with regard to its child controls - though I admit I stopped researching at that point as I had functioning code...
private void frmIdeasByProcess_Load(object sender, EventArgs e)
{
// I'm trying to host a plain form wthin a docking area - this means I can create a singe idea edit/browse form and
// just re-use it everywhere...
frmIdeaEdit frm = new frmIdeaEdit();
frm.TopLevel = false;
pnlIdeas.Controls.Add(frm);
frm.Parent = pnlIdeas;
frm.Show();
}
private void pnlIdeas_Resize(object sender, EventArgs e)
// resize the form contained with in it...
pnlIdeas.Controls[0].Height = pnlIdeas.Height;
pnlIdeas.Controls[0].Width = pnlIdeas.Width;
Set formChild.TopLevel to False before adding it to the controls collection.
pfalcon,
Thanks for updating this thread with your findings. I have the same need to dock a form within another form. Can you provide a little more detail of the code that you used to accomplish the steps you mentioned. In particular, I'm having trouble figuring out how to add a form as a child of a panel. Assuming I have a main form "Main_Form" within which I want to dock an instance of a child form "Child_Form" and that I have a panel "panelLeft" that is docking fine on the main form, I attempt the following:
Form formChild = new Child_Form();
this.panelLeft.Controls.Add(formChild);
I get an error that a top level control can not be added to a panel.
Any feedback would be greatly appreciated.
Steve
I tried similar code and I also could not get this to work. It looks like it may be a bug. I would recommend submitting the issue to the support group: http://ko.infragistics.com/gethelp.