Maybe I should add additional code and clarify what I am trying to do?
Public WithEvents MyWindow As RenderWindow
Here are the 3 primary subs I am using for my mouse events.
Private Sub MyWindow_MouseButtonPressed(sender As Object, e As MouseButtonEventArgs) Handles MyWindow.MouseButtonPressed
MyControlMouseDown(sender, e)
End Sub
Private Sub MyWindow_MouseButtonReleased(sender As Object, e As MouseButtonEventArgs) Handles MyWindow.MouseButtonReleased
MyControlMouseUp(sender, e)
End Sub
Private Sub MyWindow_MouseMoved(sender As Object, e As MouseMoveEventArgs) Handles MyWindow.MouseMoved
MyControlMouseMove(sender, e)
End Sub
When any of that ^ is done, I am sending the event through to my controls, then running the following:
Public Sub MyControlMouseUp(ByVal sender As Object, ByVal e As MouseButtonEventArgs)
If MyButton.ControlRectangle.Contains(e.X, e.Y) Then
MyButton.MouseUp(sender, e)
' Fire off events here that happen when the mouse button is up on this control.
End If
End Sub
The above is like the middle man, and sends events through to other control events. When a control, like my button, is sent a mouse up event, it stops drawing the button down gfx I have to show that the button is being hit.
Regardless if my buttons (drawn controls) are declared with events or not, I have to use this middleman procedure to pass events off to them, unless I want to try and fire everything off in the main mouse event subs...and with the amount of custom drawn controls I have, would be way too many to shove in there.
So I am looking for a better way to go about this, particularly being able to have the drawn objects (controls) be able to handle their own events.