2012-08-02 66 views
0

我需要经过很多第二隐藏当前窗体,然后显示出任何形式的自动隐藏在C#一种形式后,很多二,显示出另一种形式

我在写这个代码,但它不工作。

namespace tempprj 
{ 
    public partial class ProfileFrm : Telerik.WinControls.UI.RadForm 
    { 
     public ProfileFrm() 
     { 
      InitializeComponent(); 
     } 

     private void ProfileFrm_Load(object sender, EventArgs e) 
     { 
      Frm2 child = new Frm2(); 
      Thread.Sleep(3000); 
      this.Hide(); 
      child.ShowDialog(); 
     } 
    } 

}

+0

你试图使一个启动画面? – 2014-07-08 04:40:00

回答

0

这是我的问题的解决方案:

private void ProfileFrm_Load(object sender, EventArgs e) 
    { 
     timer1.Tick += new EventHandler(timer1_Tick); 

     timer1.Enabled = true; 
     timer1.Interval = 4000; 
     timer1.Start(); 

    } 

    private void timer1_Tick(object sender, EventArgs e) 
    { 
     timer1.Stop(); 

     this.Hide(); 
     Frm2 f = new Frm2(); 

     f.ShowDialog(); 
    }