2012-08-02 74 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(); 
    }