Add Event to a User Defined Control

MatP

Newcomer
Joined
Oct 12, 2004
Messages
11
Hi,

I use a user defined control in my project (named CodeBox, it isn't me that create it, but I have the code). This control contain a Panel and a RichTextBox.

I want to add an event to the CodeBox that would be accessible when added to my main form (accessible in the Method ComboBox in Vs.Net) The event would handles CodeBox.SelectionChanged, and happen when the event RichTextBox.SelectionChanged happen.

I'm sure it isn't difficult, but I'm not too familiar with adding events.

Thanks for the help
 
hmm, I think I've found how to do it...

Declare the event:
Public Event SelectionChanged()

and raise it in the richtextbox_selectionChanged Event:
RaiseEvent SelectionChanged()
 
Back
Top