Hover Over Comments

6 posts, 0 answers
  1. Rick
    Rick avatar
    3 posts
    Member since:
    Oct 2012

    Posted 22 May 2012 Link to this post

    I need to get an event when users hover over comment text. Is there a way to do this?

    Thanks!
  2. Lancelot
    Lancelot avatar
    251 posts
    Member since:
    Jul 2012

    Posted 23 May 2012 Link to this post

    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

  3. DevCraft banner
  4. Martin Ivanov
    Admin
    Martin Ivanov avatar
    104 posts

    Posted 25 May 2012 Link to this post

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

  5. Asif Hossain
    Asif Hossain avatar
    4 posts
    Member since:
    Nov 2012

    Posted 11 Dec 2012 Link to this post

    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
  6. Arun
    Arun avatar
    3 posts
    Member since:
    Aug 2013

    Posted 26 Jun 2015 Link to this post

    Hi Team,

     

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

  7. Petya
    Admin
    Petya avatar
    975 posts

    Posted 30 Jun 2015 Link to this post

    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
Back to Top
DevCraft banner