Raise event of a control from a class derived from the control

Hi all, long term user, but first time poster!
My goal is simple. I am creating a very simple script editor for my desktop app(on Mac).
I wish to pass on the MouseWheel event from the TextArea1 to TextArea2.
For this I have create a class Called xTextArea that derives from DesktopTextArea. in this class I have a method called Scroll.

Public Function Scroll(x As integer, y As integer, deltaX As integer, deltaY As integer) As Boolean
Return RaiseEvent MouseWheel(x,y,deltaX,deltaY)
End Function

So when I scroll the editor DesktopextArea, on the MouseWheel, I can call the method scroll on the other one which is a xTextArea, and thus, it receiving the the deltaX and deltaY values.

Unfortunately it does not compile and says MouseWheel does not exists! . if it derives from DesktopTextArea, surely I should be able to call its events. Am I missing something?

Nope. You can’t raise a built-in event, that’s the framework’s responsibility.

Ouch! Thank you for the quick response.

You’re welcome.

Look at the control’s VerticalScrollPosition property. When you receive a MouseWheel scroll event on one control, you can read its value and set that value on the other control to keep them in sync.

Yes that’s what I was doing but you loose the smoothness of the DesktopTextArea scrolling. I wish they would a Scroll Method as you find it on the canvas

Good point. This would make a fine feature request, and I encourage you to do so.