winform 多线程中ShowDialog()步骤无效的解决办法

private void Form1_Load(object sender, EventArgs e)

{

    Thread thread = new Thread(remind);

    thread.IsBackground = true;

    thread.Start();

}

private void remind()

{

   while (true)

   {

      string h = "0";

      string m = "23";

      if (h == DateTime.Now.Hour.ToString() && m == DateTime.Now.Minute.ToString() && DateTime.Now.Second.ToString() == "0")

      {

          Form2 form2 = new Form2();

          form2.ShowDialog();

          Thread.Sleep(1000);

      }

   }

}

form2的ShowDialog()显示并不是模式窗体,如何解决这种情况???

解决办法:

 Form2 form2 = new Form2();

 form2.ShowDialog(this);

 

上一篇:telnet 相关


下一篇:Altium 怎么改变3d显示时的油墨颜色