示例#1
0
 private void AddMsg(string txt, Color color)
 {
     Thread.Sleep(0);
     if (base.InvokeRequired)
     {
         base.Invoke(new FrameDisplay.AddMsgDelegate(this.AddMsg), new object[]
         {
             txt,
             color
         });
     }
     else
     {
         try
         {
             if (Program.SaveLog == 1)
             {
                 LogWritter.WriteLine(txt);
             }
         }
         catch
         {
         }
         try
         {
             if (txt.Length > 0)
             {
                 this.textbox.Select(this.textbox.Text.Length, 0);
                 this.textbox.SelectionColor = color;
                 this.textbox.AppendText(txt);
                 this.textbox.Select(this.textbox.Text.Length, 0);
                 this.textbox.ScrollToCaret();
             }
         }
         catch
         {
         }
         Application.DoEvents();
     }
 }