父子窗口形式.. [英] parent and child window forms..

查看:75
本文介绍了父子窗口形式..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3个窗口形式父窗体,子窗体和第3个样本窗体。

i使用父MenuStrips选项以父窗体打开子窗体。使用以下代码...

I have 3 window forms parent form, child form and 3rd is sample form.
i have opened child form in parent form by using parent MenuStrips option .following code is used ...

private void ChildFormToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (var child in this.MdiChildren)
{ child.Close(); }
this.menuStrip1.MdiWindowListItem = ChildFormToolStripMenuItem;
ChildForm Cf = new ChildForm();
Cf.MdiParent=this;
Cf.Show();
Cf.WindowState = FormWindowState.Maximized;
}





这个工作正常..

现在我想打开第3个样本表格通过单击子表单上的按钮以父表单形式。



从子表格上的按钮我想在父表格中打开第3个样本表格。



谢谢。



this is working properly..
now i want to open 3rd sample form in parent form by clicking a button on child form.

From a button on child form i want to open a 3rd sample form inside parent form.

thank you.

推荐答案

因此,在父窗体处理的子窗体中创建一个事件。父母然后创建子表单并显示它。

这很容易做到:在两种表格之间传递信息,第2部分:儿童到父母 [ ^ ]解释过程(除其他外)
So create an event in the child form which the parent handles. The parent then creates the sub form and displays it.
It''s very easy to do: Transferring information between two forms, Part 2: Child to Parent[^] explains the process (among other things)


这篇关于父子窗口形式..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆