2014-02-05 115 views
0

Textbox和規則所列應停止並等待用戶按Button信息後,讓他「秀」他讀過的信息...繼續代碼按下按鈕

此代碼後應向前跑,並在下一循環

再次等待(我找了活動等等,但我沒有找到任何解決方案)如果你希望你的程序停止,讓用戶確認

public void Auslesen(object e, EventArgs myevent) 
    { 

     StringBuilder strbuildsection = new StringBuilder(); 
     StringBuilder strbuildbetreff = new StringBuilder(); 
     StringBuilder strbuildinhalt = new StringBuilder(); 
     StringBuilder strbuilduser = new StringBuilder(System.Environment.UserName); 
     StringBuilder strbuildusercheck = new StringBuilder(); 


     foreach (string Ccat in this.ini.IniGetCategories()) 
     { 
      string readval = ini.IniReadValue(Ccat, "Read"); 
      string usercheckvar = (this.ini.IniReadValue(Ccat, "SpecifyUser")); 
      string user = System.Environment.UserName; 

      if (readval == "0") 
      { 
       if (usercheckvar == user || usercheckvar.Equals("All")) 
       { 
        strbuildsection.Append(Ccat + Environment.NewLine); 

        foreach (string cat in this.ini.IniGetKeys(Ccat)) 
        { 
         strbuildinhalt.Clear(); 
         strbuildusercheck.Clear(); 
         strbuildbetreff.Clear(); 

         strbuildbetreff.Append(this.ini.IniReadValue(Ccat, "Betreff") + Environment.NewLine); 
         strbuildinhalt.Append(this.ini.IniReadValue(Ccat, "Inhalt") + Environment.NewLine); 
        } 

        textBox1.AppendText(strbuildsection.ToString() + strbuildbetreff.ToString() + strbuildinhalt.ToString() + strbuildusercheck.ToString() + Environment.NewLine); 
         strbuildsection.Clear(); 

        // 
        // 
        // 
       } 
      } 
     } 

    } 
+1

無論如何,這是某種事件驅動的程序。這些程序不會爲用戶「停止」。相反,他們對用戶做出反應。 –

+0

他們如何與用戶「反應」? – Schrader

+0

當用戶做某事時會觸發事件。應用程序的所有代碼都在事件處理程序中,對事件作出反應。 –

回答

相關問題