Hyperlinks

9 posts, 1 answers
  1. GM
    GM avatar
    6 posts
    Member since:
    Jul 2011

    Posted 18 Jul 2011 Link to this post

    Is it possible to add hyperlinks to the RichTextBox and if so, is it possible to "catch" those links so that if a person for example clicks on a particular link you can programmatically call a procedure.

    (I normally do this with the Microsoft Browser Control)
  2. Svett
    Admin
    Svett avatar
    728 posts

    Posted 21 Jul 2011 Link to this post

    Hi Gm,

    Thank you for your feedback.

    We will implement the hyperlink support in the upcoming service pack. I added your suggestion to our public issue tracking system as a feature request.

    All the best,
    Svett
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. UI for WinForms is Visual Studio 2017 Ready
  4. GM
    GM avatar
    6 posts
    Member since:
    Jul 2011

    Posted 11 Dec 2011 Link to this post

    I have revisited this control with your new release (Q3 2011).

    Seems that the hyperlink feature is now implemented - most welcome.

    However, I picked up the following possible bugs:
    1 -    RadRichTextBox1.HyperlinkNavigationMode - setting it to click in either design mode or through runtime code does not work - have to use Ctrl Click to navigate the hyperlink

    2 - RadRichTextBox1.HyperlinkToolTipFormatString - cannot be set at design time - need to set it via code.

    3 - Seems that the following code is not executed when the hyperlink is clicked (ctrl clicked):
    Private Sub RadRichTextBox1_HyperlinkClicked(sender As Object, e As Telerik.WinControls.RichTextBox.Model.HyperlinkClickedEventArgs) Handles RadRichTextBox1.HyperlinkClicked
        MsgBox("YOU CLICKED A HYPERLINK")
    End Sub

    Input is most welcome on this.


  5. Svett
    Admin
    Svett avatar
    728 posts

    Posted 14 Dec 2011 Link to this post

    Hello Gm,

    I managed to set the HyperlinkNavigationMode and HyperlinkToolTipFormatString properties of the RadRichTextBox control. The navigation mode property does not change the hyper link behavior. This issue will be addressed for the upcoming service pack. I did not manage to reproduce the HyperlinkClicked event issue. What did I miss? Could you share more details about your scenario and how to reproduce it?

    Notice that I am using the latest release Q3 2011 (2011.3 11.1116).

    I updated your Telerik points.

    Regards,
    Svett
    the Telerik team

    Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

  6. GM
    GM avatar
    6 posts
    Member since:
    Jul 2011

    Posted 14 Dec 2011 Link to this post

    Many thanks for yourkind reply.

    Further to the Hyperlink clicked event issue:

    If you click (or ctrl click) a hyperlink what the RadRichTextBox does is open the link in a new external web-browser.

    My issue is this: my hyperlink must display a message box something to the following:
    ie. When the hyperlink is clicked: msgbox ("You clicked " & hyperlink)  - [hyperlink is the link that was clicked]. A web browser must not open up.

    I successfully implemented this using a standard web browser control using the following code:
    Private Sub WebBrowser1_Navigating(sender As Object, e As System.Windows.Forms.WebBrowserNavigatingEventArgs) Handles WebBrowser1.Navigating

        If e.Url.ToString() <> "about:blank" Then
            e.Cancel = True
        End If
     
        Dim MESSAGETEXT As String = ""
        MESSAGETEXT= e.Url.ToString.Remove(0, 6)
        MsgBox(MESSAGETEXT)

    End
    Sub

    Can anything close to this be achieved with the RadRichTextBox control.

    The possibilities are endless if one replaces the MsgBox line with some custom code - this is where coding gets interesting.


    Looking forward to your answer.
  7. sameer
    sameer avatar
    1 posts
    Member since:
    Jun 2011

    Posted 15 Dec 2011 Link to this post

    hey Gm ,
    did u got the solution for hyperlinked event, even m also not getting that event fired.........
    please let me know ASAP, it will greatful.
    thanks 
  8. Svett
    Admin
    Svett avatar
    728 posts

    Posted 19 Dec 2011 Link to this post

    Hello guys,

    @Gm:

    Presently, the HyperlinkedClicked event is fired only in HyperlinkNavigationMode.CtrlClick mode. This issue is related to the HyperNavigationMode issue that I have mentioned earlier. You can show in MessageBox the clicked URL by using the following code snippet:

    Private Sub radRichTextBox1_HyperlinkClicked(sender As Object, e As HyperlinkClickedEventArgs)
        MessageBox.Show(e.URL)
    End Sub

    @Sameer: I am glad to inform you that the issue has already been addressed for the upcoming service pack which will be published this week.

    Regards,
    Svett
    the Telerik team

    Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

  9. GM
    GM avatar
    6 posts
    Member since:
    Jul 2011

    Posted 19 Dec 2011 Link to this post

    Many thanks for your reply.  

    Tried with the Ctrl Click -
    the event is still not fired.

    Tried with Click - even still not fired (as expected)


    Svett - It seems you have it working with Ctrl Click for now. Can you please include a small sample project so that I can see where I am going wrong as you seem to have it working with Ctrl Click.

    Looking forward to your reply.


  10. Answer
    Prijesh
    Prijesh avatar
    1 posts
    Member since:
    Dec 2011

    Posted 21 Dec 2011 Link to this post

    hey GM,
    I found the way to fire that event after trying many ways 
    first of all you have to add handler to the hyperlink clicked event

    AddHandler RadRichTextBox1.HyperlinkClicked, AddressOf hyperlinkclick


    now you write your code in hyperlinkclick procedure

    Public Sub hyperlinkclick(ByVal sender As Object, ByVal e As Telerik.WinControls.RichTextBox.Model.HyperlinkClickedEventArgs) Handles RadRichTextBox1.HyperlinkClicked
            Try
                e.Handled = True
              ''Write your code that you want
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
        End Sub


    this is working for me, hope you find it helpful

Back to Top
UI for WinForms is Visual Studio 2017 Ready