Calling up DockPanel-Suite's "AutoHidden" DockContent programmatically
- by Lockszmith
I am having trouble causing an 'autohide' dock to appear programmatically.
Couldn't find any answer around the net, though the following SO Question suggested that .Show() should have done the trick
I've tried this on the latest NuGet version of the code.
My test code is below.
Anyone know how to do it? or what I'm doing wrong?
My test Code
Create a simple Visual Studio Windows Form application, and replace the main form's source file content with this code:
using System;
using System.Windows.Forms;
using dps = WeifenLuo.WinFormsUI.Docking;
namespace testDockPanel
{
public partial class Form1 : Form
{
private dps.DockPanel dockPanel;
private dps.DockContent dc;
private Control innerCtrl;
public Form1()
{
InitializeComponent();
dockPanel = new dps.DockPanel();
dockPanel.Dock = DockStyle.Fill;
dockPanel.DocumentStyle = dps.DocumentStyle.DockingWindow;
toolStripContainer1.ContentPanel.Controls.Add(dockPanel);
dc = new dps.DockContent();
dc.DockPanel = dockPanel;
dc.DockState = dps.DockState.DockRightAutoHide;
innerCtrl = new WebBrowser() { Dock = DockStyle.Fill };
dc.Controls.Add( innerCtrl );
// This SHOULD show the autohide-dock, but NOTHING happens.
dc.Show();
}
}
}