Suppose that for every Form in a WinForms application, you want to change the cursor to the WaitCursor. The obvious way to do this would be to add the code to every place where a form is instantiated/shown:
Try
Me.Cursor = Cursors.WaitCursor
Dim f As New frmMyForm
f.Show()
Catch ex As Exception
Throw
Finally
Me.Cursor = Cursors.Default
End Try
However, I was wondering if there is a way to tell your application, "Whenever any form Load event fires, show a WaitCursor. When the form event Shown is complete, set the cursor back to Default." This way, the Me.Cursor code could be only in one place and not scattered throughout the application - and not forgotten to put it in to each form instantiation.
I suppose you could subclass the regular Form class and add the cursor settings in an overridden event, but I believe you lose the visual designer capability when you subclass the Form object.