From bd818d50ecaa95295536536bf71577ed0f1dc229 Mon Sep 17 00:00:00 2001 From: brianlagunas_cp Date: Tue, 15 Mar 2011 14:19:48 +0000 Subject: [PATCH] RichTextBoxFormatBar: fixed bug when selecting text and trying to show a context menu, such as spell check. The RTBFormatBar would not allow the context menu to show. --- .../RichTextBoxFormatBarManager.cs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBoxFormatBar/RichTextBoxFormatBarManager.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBoxFormatBar/RichTextBoxFormatBarManager.cs index 8fbc1e31..b1cff436 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBoxFormatBar/RichTextBoxFormatBarManager.cs +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBoxFormatBar/RichTextBoxFormatBarManager.cs @@ -54,27 +54,23 @@ namespace Microsoft.Windows.Controls void RichTextBox_MouseButtonUp(object sender, MouseButtonEventArgs e) { - if (e.LeftButton == MouseButtonState.Released) + if (e.ChangedButton == MouseButton.Left && e.LeftButton == MouseButtonState.Released) { TextRange selectedText = new TextRange(_richTextBox.Selection.Start, _richTextBox.Selection.End); -#if !VS2008 +#if !VS2008 if (selectedText.Text.Length > 0 && !String.IsNullOrWhiteSpace(selectedText.Text)) - { ShowAdorner(); - } #else if (selectedText.Text.Length > 0 && !String.IsNullOrEmpty(selectedText.Text)) - { ShowAdorner(); - } #endif else - { HideAdorner(); - } - } - e.Handled = true; + e.Handled = true; + } + else + HideAdorner(); } void RichTextBox_PreviewMouseMove(object sender, MouseEventArgs e)