我的MDI没有正确开始

时间:2012-08-02 21:33:14

标签: c# winforms mdi

我的C#MDI应用程序在program.cs中启动,如下所示:

namespace APRSTW
{
    static class Program
    {
        public static Form parentForm;
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            parentForm = new MainAPRSTW();//<-so I can reference this form as a parent in other .cs files.
            Application.Run(parentForm);
        }
    }
}

MainAPRSTW的构造函数如下所示:

public MainAPRSTW()
{
    frmSplash objfrmSplash = new frmSplash();
    objfrmSplash.ShowDialog();

    //windows init
    InitializeComponent();

    //Initialize the program
    InitProgram();

}//close main

我已经发布了一个PNG屏幕截图,显示程序在

运行时会发生什么

http://www.Blandranch.net/Files/Capture.PNG(案件在.net之后重要)

您正在看到子表单的轮廓,而孔是文本框和组。我从未见过父母的表格。

我做错了什么?

1 个答案:

答案 0 :(得分:0)

我认为显示启动画面是个问题。如果告诉应用程序您从1表单开始,则在显示第一个表单之前不能跳转到另一个表单。您应该做的是从Application.Run显示您的启动画面,然后让您的启动画面显示您的MDI表单。