Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return either dataset or integer from function
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00892206
Message ID:
00899201
Vues:
15
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

' Then when I go to show the form.
    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.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform