1

I've been searching quite a lot and studying the Docksuite sample but haven't been successful in getting a simple screen working. I would like to have a form on top and two forms opened on the left.

What I have done so far:

  1. Created a FormMainDock that holds a DockPanel; isMDIContainer = True
  2. Created three Forms that inherit from DockContent
  3. In the FormMainDock have the following code:

...

Private Sub FormMainDock_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  Me.DockPanel1.Theme = New VS2015DarkTheme
  Dim fTop As New FormTop
  fTop.Show(DockPanel1, DockState.DockTop)
  fTop.DockPanel.DockTopPortion = 120

  Dim fLeft1 As New FormLeft1
  fLeft1.Show(DockPanel1, DockState.DockLeft)

  Dim fLeft2 As New FormLeft2
  fLeft2.Show(DockPanel1, DockState.DockLeft)
  fLeft2.DockPanel.DockLeftPortion = 400

End Sub

...

and that shows me

Example 1

Now what I would like to have is this

Example 2

I have no idea how to get the two forms opened on startup. Any help would be appreciated.

John
  • 87
  • 11
  • Insert 2 forms into TableLayoutPanel and then dock it or anchor to 4 sides. – Sorry IwontTell Nov 17 '20 at 17:11
  • https://ibb.co/WkbxKdv – Sorry IwontTell Nov 17 '20 at 17:13
  • Thanks for trying to help me out but I really want the functionality of the dockingpanel suite. Like moving forms, closing and or re-open them, docking in any direction at any location. I know you can get very far by using Split-containers and the TableLayoutPanel, but using the Dockingpanel is what it\this is meant for. – John Nov 19 '20 at 05:57
  • 1
    https://github.com/dockpanelsuite/dockpanelsuite/issues/267 – Lex Li Nov 29 '20 at 07:23

1 Answers1

0

Even though I already looked at the demo source, I looked again, knowing that this code worked and the tip from Lex Li to look at it again I forced myself to dive a bit deeper, and with the help of some C# translators I figured it out. Of course in the end it is quite simple. So for anyone else to solve it quicker here is all you have to do:

First, create a MainForm that holds a DockPanel and set isMDIContainer = True. Create three Forms that inherit from DockContent (don't forget to Import the WeifenLuo.WinFormsUI.Docking). Then when you want to get the sample that is in the picture use this:

Private Sub FormMainDock_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  Me.DockPanel1.Theme = New VS2015DarkTheme 'This line isn't necessary

  Dim fTop As New FormTop
  fTop.Show(DockPanel1, DockState.DockTop)

  Dim fLeft1 As New FormLeft1
  fLeft1.Show(DockPanel1, DockState.DockLeft)

  Dim fLeft2 As New FormLeft2
  fLeft2.Show(fLeft1.Pane, DockAlignment.Bottom, 0.5)
End Sub

That's all. Have fun with it.

John
  • 87
  • 11