Hey,

I am using some usercontrol that contains an RichTextBox.
I didn't create the user control myself, but I have been trying to understand how it works.


I needed the "RTB_SelectionChanged" event in my program, but noticed that it wasn't there... It's just not in the list.

So I had a look in the usercontrol's code. I can see a whole lot of events being declared, like this for example:
Code:
    Private Sub RTF_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles RTF.KeyPress
        'raise up the event
        Me.OnKeyPress(e)
    End Sub
There was also a "Private Sub RTF_SelectionChanged" event, with some code in it, so I still didn't know why it didn't show...

Then I noticed the following..:

In the RTF_KeyPress example, there is the line "Me.OnKeyPress(e)" which, according to the comments, raises the event...

So I tried adding the same line to the SelectionChanged event:

Code:
    Private Sub RTF_SelectionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RTF.SelectionChanged

        'Some code here

        'Raise the event
        Me.OnSelectionChanged(e)
    End Sub
However, VS says it doesn't know "Me.OnSelectionChanged"... Huh?
OnSelectionChanged is not a member of <usercontrol name>...


How can I make it have the SelectionChanged event?!