本文介绍了如何使SplitContainer1.Panel2作为所有子窗体的父级?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3种形式

Form1作为Mdicontainer
form2
Form3

Form1具有SplitContainer1,Treeview1控件,并且form1正在运行
作为MdiContainer

Treeview1放置在Splitcontainer1.Panel1内,其中Dock为填充

form2-Button1,Button2:
在form1加载事件中,我已经编写了显示Form2的代码

I have 3 forms

Form1 as Mdicontainer
form2
Form3

Form1 has SplitContainer1,Treeview1 Controls and form1 is acting
as MdiContainer

Treeview1 is placed inside Splitcontainer1.Panel1 With Dock as Fill

form2 - Button1,Button2:
in form1 load event i have written the code to show Form2

form2 f = new form2();
f.MdiParent = this;
f.Parent = this.splitContainer1.Panel2;
f.FormBorderStyle = FormBorderStyle.None;
f.ShowInTaskbar = false;
f.Dock = DockStyle.Fill;
f.StartPosition = FormStartPosition.CenterScreen;
f.Show();


它完美地显示了form2.

当我单击Button1(form2)时,我想向Form3展示,就像我如何编写代码以显示Form2一样.

有什么想法让我真诚地知道.

问候,
Pawan.


It shows the form2 Perfectly..

When i click on Button1(form2), i want to show Form3 like how i wrote the code to show form2.

have any idea do let me know sincerely.

Regards,
Pawan.

推荐答案


这篇关于如何使SplitContainer1.Panel2作为所有子窗体的父级?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 14:43