Only one DockContent in DockPanel

This is what my setup looks like: current setup

This is a DockPanel package. The white area is the visual component of dockPanel, which I fell in shape. I don't need docking, nested docking, drop tabs, etc. I just need the ProjectsForm panel and you want it to automatically hide and hide when clicked by the user.

So my questions are: how can I convert the previous picture to look like this: New, desired view

How can I prevent this panel from floating?

Here is the code:

private void MainForm_Load(object sender, EventArgs e)
{
    DockContent dockProjectsContent = new ProjectsForm();
    dockProjectsContent.AllowDrop = false;
    dockProjectsContent.AllowEndUserDocking = false;
    dockProjectsContent.ShowHint = DockState.DockLeft;            
    dockProjectsContent.Show(dockProjects);            
}
+1
source share
1 answer

Why don't you create a DockContent for the “body” of your form (you won’t leave it empty, how are you ?!) open this in the middle of the dock panel ?!

dockpanel DocumentStyle "DockingWindow"

dockProjects.DocumentStyle = DocumentStyle.DockingWindow

..

dockProjectsContent.Show(this.dp, DockState.DockRight);
dockMainContent.Show(this.dp, DockState.Document);

DockContent, .

dockProjectsContent.AllowEndUserDocking = false;

, , , !

0

All Articles