Esempio n. 1
0
 private void Write(string text, Color color)
 {
     LogTextBox.Focus();
     LogTextBox.SelectionLength = 0;
     LogTextBox.SelectionColor  = color;
     LogTextBox.AppendText(text + "\n");
     LogTextBox.Refresh();
 }
Esempio n. 2
0
 private void SuspendDrawLog(bool suspend = true)
 {
     if (suspend)
     {
         SendMessage(LogTextBox.Handle, WM_SETREDRAW, false, 0);
     }
     else
     {
         SendMessage(LogTextBox.Handle, WM_SETREDRAW, true, 0);
         LogTextBox.Refresh();
     }
 }
Esempio n. 3
0
 private void Logbox_Update(object sender, LogboxEventArgs e)
 {
     if (LogTextBox.InvokeRequired)
     {
         var deleg = new SetLogboxMessage(Logbox_Update);
         try // to catch ObjectDisposedException if there are still events outstanding when the MainGUI is already gone
         {
             Invoke(deleg, sender, e);
         }
         catch
         {
         }
     }
     else
     {
         LogTextBox.Text          += e.message + Environment.NewLine;
         LogTextBox.SelectionStart = LogTextBox.Text.Length;
         LogTextBox.ScrollToCaret();
         LogTextBox.Refresh();
     }
 }
Esempio n. 4
0
 /// <summary>
 /// テキストボックスを強制的に再描写する
 /// </summary>
 public void Refresh()
 {
     MainForm.BeginInvoke(new Action(() => { LogTextBox.Refresh(); }));
 }