Simon,
Glad I look good for my age! <g>
Here is the code for this to work in VB.NET The Try/Catch is in the class that makes the call the instaniate the form, not in the Load of the form.
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) _
Handles MyBase.Load
Throw New Exception("Please Don't Load Me!")
End Sub
Public Sub Test()
Try
Dim oForm As Form1 = New Form1
oForm.Show()
Catch ex As Exception
MessageBox.Show(ex.ToString(), "Form did not show")
End Try
End Sub
>Thanks Cathie
>
>Only my mother-in-law calls me Simone, so you're looking good for your age, lol...
>
>Forgive me for asking another question on this: Would I put a Return .f. in the Catch clause to stop a form from loading? And then have an End Try statement to stop the Finally clause from firing?
>
>TIA,
>Simon
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi