/// <summary> /// 「ログ」テキストボックス内が変更されたとき /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void textBoxLog_TextChanged(object sender, TextChangedEventArgs e) { textBoxLog.ScrollToEnd(); if (textBoxLog.LineCount >= 1000) { //textBoxLog.Clear(); TextBoxClearDelegate InvokeClear = new TextBoxClearDelegate(ClearTextBox); textBoxLog.Dispatcher.Invoke(InvokeClear, new Object[] { textBoxLog }); } }
public virtual void TextBoxClear(TextBox Object) { if (this.InvokeRequired) { TextBoxClearDelegate dele = new TextBoxClearDelegate(TextBoxClear2); this.Invoke(dele, new object[] { Object }); } else { TextBoxClear2(Object); } }