提供一种在MDI表单中创建两个或多个子表单的解决方案 [英] give a solution for creating two or more child forms in a mdi form

查看:43
本文介绍了提供一种在MDI表单中创建两个或多个子表单的解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在相同的mdi表单中的另一个子表单请求时,如何将表单显示为子表单?
请使用代码

how to display a form as a child when it is requested by an another child form within the same mdi form??
give me a sloution please with code

推荐答案

1.这里的人不喜欢写别人的作业.
2.发出请求很不礼貌.
3.您的问题很简单,所以这是一般的想法:
1. People here don''t like to write other people''s homework.
2. It is very rude make requests.
3. Your problem is very straightforward, so this is the general idea:
//******************************************
//          inside child form
//******************************************
this.MdiParent.ShowAnotherChild(formKey);


//******************************************
//          inside mdi parent form
//******************************************

//I find it easier to work with dictionary than with existing MdiChildren property
Dictionary<sting,form> _mdiChildren = new Dictionary<string,form>();

void ShowAnotherChild(string formKey)
{
    if(!_mdiChildren.ContainsKey(formKey))
    {
        AnotherChild newChild = new AnotherChild();
        //...
        //code to configure a new form as a mdi child goes here
        //...
        _mdiChildren.Add(formKey, newChild); 
    }

    _mdiChildren[formKey].Show();
    _mdiChildren[formKey].BringToFront();
}



尝试从这里自己解决问题.



Try to work it out by yourself from here.



有关更多详细信息,请通过此链接-
使用C#引入MDI表单 [开发mdi应用程序incsharp.aspx [
Hi,
For more details go through this link-
Introduction to MDI Forms with C#[^]
developing mdi appplications incsharp.aspx[^]


您可能会从阅读中受益来自CodePRoject的本文:
使用C#引入MDI表单 [
You might befifit from reading this article from CodePRoject:
Introduction to MDI Forms with C#[^]


这篇关于提供一种在MDI表单中创建两个或多个子表单的解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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