Let's say we want a bell to ring when we click the mouse.
It's easy enough to create a subroutine that rings the bell.
Sub PlayBell
Sound.PlayBellRing()
EndSub
But how do we tell this subroutine to play when the mouse is clicked?
We use something called 'events'.
 This icon indicates an event |
Normally if you wanted to play the bell you would write
PlayBell()
However when setting an event, you leave off the parentheses to indicate that you are not calling the subroutine, but rather that you want the subroutine to be called.
GraphicsWindow.MouseDown = PlayBell