Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What's wrong with this?
#1
The error I'm getting is ('Catch' cannot appear outside of a 'Try' statement)

It looks to me like it isn't...

Code:
Public Class Form1

    Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try
            If TextBox1.Text = TextBox2.Text Then
                Me.Hide()
                black.Show()
                My.Settings.Password = TextBox2.Text
            Else
                MessageBox.Show("Passwords do not match!")
            End If
        Catch ex As Exception
            MessageBox.Show(ex.ToString)
        End Try
    End Sub
End Class
VB, 2010 if you're wandering.
Reply


Messages In This Thread
What's wrong with this? - by Sam - 01-09-2012, 04:33 AM
RE: What's wrong with this? - by AceInfinity - 01-09-2012, 04:49 AM
RE: What's wrong with this? - by Sam - 01-09-2012, 04:54 AM
RE: What's wrong with this? - by AceInfinity - 01-09-2012, 04:55 AM
RE: What's wrong with this? - by Sam - 01-09-2012, 04:58 AM
RE: What's wrong with this? - by AceInfinity - 01-09-2012, 05:03 AM
RE: What's wrong with this? - by Sam - 01-09-2012, 06:48 AM
RE: What's wrong with this? - by AceInfinity - 01-09-2012, 08:32 AM
RE: What's wrong with this? - by Sam - 01-09-2012, 11:44 AM

Forum Jump:


Users browsing this thread: 3 Guest(s)