This is a migrated thread and some comments may be shown as answers.

Hover Over Comments

5 Answers 103 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Rick
Top achievements
Rank 1
Rick asked on 23 May 2012, 01:56 AM
I need to get an event when users hover over comment text. Is there a way to do this?

Thanks!

5 Answers, 1 is accepted

Sort by
0
Lancelot
Top achievements
Rank 1
answered on 23 May 2012, 09:13 PM
Hi Rick,

Here is the currently supported events for the RadRichTextBox control....

The RadRichTextBox control raises the following specific events:
  • CommandError - occurs when an error gets thrown while executing a command. The event handler receives two arguments:

    • The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
    • A CommandErrorEventArgs object.
  • CommandExecuted - occurs after a command gets executed. The event handler receives two arguments:

    • The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
    • A CommandExecutedEventArgs object. This arguments allows you to access the command to be executed and its command parameter.
  • CommandExecuting - occurs before a command gets executed. The event handler receives two arguments:

    • The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
    • A CommandExecutingEventArgs object. This arguments allows you to access the command to be executed and its command parameter and to cancel the command execution.
  • CurrentEditingStyleChanged - occurs when the current editing style changes. The event handler receives two arguments:

    • The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
    • An EventArgs object
  • CurrentParagraphStyleChanged - occurs when the position of the caret goes to another paragraph. The event handler receives two arguments:

    • The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
    • An EventArgs object.
  • CurrentSpanStyleChanged - occurs when the position of the caret goes to another word. The event handler receives two arguments:

    • The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
    • An EventArgs object.
  • CurrentVisiblePageChanged - occurs when the current page has changed. The event handler receives two arguments:

    • The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
    • An EventArgs object.
  • DocumentArranged - occurs when the current document has been arranged. The event handler receives two arguments:

    • The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
    • An EventArgs object.
  • DocumentChanged - occurs when the current document has been changed. The event handler receives two arguments:

    • The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
    • An EventArgs object.
  • DocumentChanging - occurs before the current document gets changed. The event handler receives two arguments:

    • The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
    • An EventArgs object.
  • DocumentContentChanged - occurs when the content of the current document has changed. The event handler receives two arguments:

    • The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
    • An EventArgs object.
  • DocumentLayoutModeChanged - occurs when the layout mode of the current document has changed. The event handler receives two arguments:

    • The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
    • An EventArgs object.
  • HyperlinkClicked - occurs when the current page has changed. The event handler receives two arguments:

    • The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
    • A HyperlinkClickedEventArgs object. This argument allows you to access the URL and the target of the hyperlink.
  • IsReadOnlyChanged - occurs when IsReadOnly value has changed. The event handler receives two arguments:

    • The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
    • An EventArgs object.
  • ScaleFactorChanged - occurs when the ScaleFactor value has changed. The event handler receives two arguments:

    • The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
    • An EventArgs object.
  • SelectedLayoutBoxChanged - occurs when the current layout box gets changed. The event handler receives two arguments:

    • The sender argument contains the RadRichTextBox. This argument is of type object, but can be cast to the RadRichTextBox type.
    • A SelectedLayoutBoxChangedEventArgs object.


I don't see a way to get an event raised when hovering only over a comment.

You can enter a request for that feature in the Public Issue tracker and vote it up. The telerik engineers use this system to add new features to the controls. Check it out here : http://www.telerik.com/support/pits.aspx 

Lancelot

0
Martin Ivanov
Telerik team
answered on 25 May 2012, 08:31 AM
Hello Rick,

 As Lancelot said, there is no such event in our control, however you can do some custom logic for the mouse move:

this.radRichTextBox.MouseMove += new MouseEventHandler(radRichTextBox_MouseMove);
 
    void radRichTextBox_MouseMove(object sender, MouseEventArgs e)
    {
        Point p = e.GetPosition(this.radRichTextBox);
        DocumentPosition position = this.radRichTextBox.ActiveEditorPresenter.GetDocumentPositionFromViewPoint(p);
        Telerik.Windows.Documents.Model.Inline inline = position.GetCurrentInline();
        if (this.radRichTextBox.Document.GetContainingAnnotationRanges<CommentRangeStart>(inline, false).Count() > 0)
        {
            MessageBox.Show(position.GetCurrentWord());
        }
    }

In the example we show you how to attach to the mouse move event and check each time if the pointer is over a commented range. Then you can do some style manipulations to the words that are in comment. This solution may cause you some performance issues due to the frequency of this event . To improve this you can add timer for delayed execution to suppress most of mouse move events.
Don't hesitate to contact us if you have other questions.
Helpful

Regards,
Martin
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Asif Hossain
Top achievements
Rank 1
answered on 11 Dec 2012, 02:01 PM
Hi,
In the RadRichTextBox, I have added HyperlinkInfo, when i move my mouse over a Hyperlink, it shows default HyperlinkToolTipFormatString ,
Is there any way to override this mouse event (Hyperlink_in_RadRichTextBox_MouseOver) ? So that i can add tooltip(webbrowser control) in it and show custom content including images for different hyperlinks in the Rad Rich text box.

What is the event raised when mouse is over to any hyperlink in rad rich text box by which we can see HyperlinkToolTipFormatString ? Is it possible to override this event ?

Thanks
Shantu
0
Arun
Top achievements
Rank 1
answered on 26 Jun 2015, 06:29 AM

Hi Team,

 

Have the same issue which Asif Hossain has mentioned above is there a solution for it ? using latest telerik controls for silverlight.

0
Petya
Telerik team
answered on 30 Jun 2015, 01:38 PM
Hi Arun,

The visual representation of the content in RadRichTextBox is based on the concept of UI layers stacked on top of each other. This also allows you to plug any custom visual elements based on the specific requirements of your application. Please go through the following online resources that will shed more light on the way a custom UI layer can be created and integrated with the control:

I hope this information is helpful.

Regards,
Petya
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
RichTextBox
Asked by
Rick
Top achievements
Rank 1
Answers by
Lancelot
Top achievements
Rank 1
Martin Ivanov
Telerik team
Asif Hossain
Top achievements
Rank 1
Arun
Top achievements
Rank 1
Petya
Telerik team
Share this question
or