public void SetMemoText(string text){
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (ResultsMemoEdit.InvokeRequired){
         var d = new SetMemoTextDelegate(SetMemoText);
         Invoke(d, new object[]{text});
     }
     else{
         ResultsMemoEdit.Text += Environment.NewLine + text;
         ResultsMemoEdit.Select(ResultsMemoEdit.Text.Length,
             ResultsMemoEdit.Text.Length);
         ResultsMemoEdit.ScrollToCaret();
     }
     Application.DoEvents();
 }
예제 #2
0
 public void SetMemoText(string text)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (ResultsMemoEdit.InvokeRequired)
     {
         var d = new SetMemoTextDelegate(SetMemoText);
         Invoke(d, new object[] { text });
     }
     else
     {
         ResultsMemoEdit.Text += Environment.NewLine + text;
         ResultsMemoEdit.Select(ResultsMemoEdit.Text.Length,
                                ResultsMemoEdit.Text.Length);
         ResultsMemoEdit.ScrollToCaret();
     }
 }