Search code examples
vb.net

I need a way that I have to use an else to press a button that will move me to another form


I need a way that I have to use an else to press a button that will move me to another form:

    Else
    Form3.Show()
    Me.Hide()
    Exit Sub
End Sub

Solution

  • You don't need an Exit Sub directly above an End Sub.

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        If 1 <> 1 Then
            'never True
        Else
            Me.Hide()
            Form3.Show()
        End If
    End Sub