private void Write(string text, Color color) { LogTextBox.Focus(); LogTextBox.SelectionLength = 0; LogTextBox.SelectionColor = color; LogTextBox.AppendText(text + "\n"); LogTextBox.Refresh(); }
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(); } }
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(); } }
/// <summary> /// テキストボックスを強制的に再描写する /// </summary> public void Refresh() { MainForm.BeginInvoke(new Action(() => { LogTextBox.Refresh(); })); }