Results 1 to 1 of 1

Thread: RTB with hyperlink events

  1. #1

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,817

    RTB with hyperlink events

    First and foremost, The Trick deserves a great deal of the credit for this. Basically, all I did was continue polishing, and incorporated it all into the ComCtl32 type of subclassing. The whole idea originated from this thread. However, I further smartened up the subclassing for this one so that it'll allow for as many RTB controls on a single form as you like.

    Here's a screenshot of this little demo project (those are RTBs):

    Name:  rtb.png
Views: 455
Size:  9.9 KB

    And here's a screenshot of my Immediate window after clicking around on those RTB controls:

    Name:  rtbshow.png
Views: 514
Size:  2.7 KB

    And here's the event that's made possible from the subclassing.

    Code:
    
    Public Sub ClickOnRtbLink(oTheRtb As RichTextBox, sText As String)
    
        ' This event comes from the subclassing.
    
        Debug.Print oTheRtb.Name, sText
    End Sub
    

    From there, you can do what you with with the RTB hyperlink text that was clicked. Also, as a caveat, if you do this subclassing, be sure to include the ClickOnRtbLink event, as the actual subclassing depends on it being there.

    You also get my RtbOut procedure (found in RtbStuff.bas). It's just the way I make sense of sending formatted text to an RTB control. Also, it forces me to use the Arg:=value syntax, which I seldom use.

    Enjoy,
    Elroy
    Attached Files Attached Files
    Last edited by Elroy; Jan 4th, 2019 at 08:23 PM.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width