In your control, declare something like:
Public Event MyEvent(sender as object, e as eventargs)
Then, when you want to communicate with the form, raise the event as follows:
RaiseEvent MyEvent(Me, EventArgs.Empty)
On the form, you can handle this event:
Public Sub HandlesMyEvent(sender as Object, e as EventArgs) Handles MyControl.MyEvent 'Code on the form to handle the event End Sub
This way, the control doesn't need to know anything specific about the form, and doesn't need to reference the project that the form is in.
|