C# - 为什么 this.Close();剂量不适合我?

C# - why this.Close(); dose not work for me?

iam not good at ENG so you will see some Incorrect spelling and bad grammar. and i am using Visual Studio 2015.

您好。首先,我是 new 编程。

好吧,我在使用“this.Close();”时遇到了一些麻烦,我需要一些帮助...

我试图在进度条达到值 100 后简单地关闭加载表单,但它不起作用。

代码如下:

 private void pbar_timer_Tick(object sender, EventArgs e)
    {
        progressBar1.Value += 10;

            if(progressBar1.Value==100)
        {
            pbar_timer.Stop();
            new main().ShowDialog();
            this.Close();

        }

    }

嗯。我尝试了很多方法,但它不会工作... 加载表单仍然会挂在屏幕上,当主表单出现时它不会消失..:|

如果你知道我该怎么做,请帮助我...

谢谢。

ShowDialog() 方法会阻止您当前的流程,直到关闭新的“new main()”。 请改用 Show()