-1

我的 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);
        }
    }
}

for 的构造函数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之后的情况很重要)

您会看到子窗体的轮廓,并且孔是文本框和组。我从来没有看到父表格。

我究竟做错了什么?

4

1 回答 1

0

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

于 2012-08-03T11:39:20.357 回答