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):
And here's a screenshot of my Immediate window after clicking around on those RTB controls:
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
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.