Browse Source

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.

pull/1645/head
brianlagunas_cp 15 years ago
parent
commit
bd818d50ec
  1. 16
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/RichTextBoxFormatBar/RichTextBoxFormatBarManager.cs

16
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)

Loading…
Cancel
Save