/// <summary>
/// 窗体继承
/// </summary>
public partial class TestFormDock1 : DockContent
{
public TestFormDock1()
{
InitializeComponent();
}
public string listSelectName = "";
private void TestFormDock1_Load(object sender, EventArgs e)
{
listView1.Columns.AddRange(new ColumnHeader[] { new ColumnHeader("列1"), new ColumnHeader("列2"), new ColumnHeader("列3") });
ListViewGroup g = new ListViewGroup("分组");
listView1.Groups.Add(g);
ListViewItem item = new ListViewItem("", g);
listView1.Items.Add(item);
}
}
调用方法
//调用方法
testFormDock1 = new TestFormDock1();
testFormDock1.Show(this.dockPanel1);
testFormDock1.DockTo(this.dockPanel1, DockStyle.Left);
testFormDock1.DockPanel.DockRightPortion = 0.17;
testFormDock1.AutoHidePortion = 0.1;