private void RichTextBoxContent_KeyDown(object sender, KeyEventArgs e) { if (e.Modifiers == Keys.ControlKey) { switch (e.KeyData) { case Keys.C: RichTextBoxContent.Copy(); break; case Keys.A: RichTextBoxContent.SelectAll(); break; } } }
private void ControllerOnOverlayContentUpdated(bool fromView, string content) { if (RichTextBoxContent.Dispatcher.CheckAccess()) { if (_isClosed) { return; } var textRange = new TextRange(RichTextBoxContent.Document.ContentEnd, RichTextBoxContent.Document.ContentEnd); textRange.Load(new MemoryStream(Encoding.UTF8.GetBytes(content)), DataFormats.Rtf); textRange.ApplyPropertyValue(TextElement.FontSizeProperty, RichTextBoxContent.FontSize); RichTextBoxContent.ScrollToEnd(); } else { RichTextBoxContent.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(delegate { ControllerOnOverlayContentUpdated(fromView, content); })); } }
private void SelectAllCtrlCToolStripMenuItem1_Click(object sender, EventArgs e) { RichTextBoxContent.SelectAll(); }
private void CopyCtrlCToolStripMenuItem1_Click(object sender, EventArgs e) { RichTextBoxContent.Copy(); }