Question A "Close()" Problem

A Proud Nerd

New member
Joined
Dec 29, 2011
Messages
2
Location
Portugal
Programming Experience
Beginner
I am doing a App to Login with Username and Password. This is the code I used:

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = ("XXX") And (TextBox2.Text) = 123 Then
MsgBox("Hello XXX")
End If
End Sub
End Class

Here's the problem, I need to add a "Close()" function in case the password is not 123, but I am not sure how to do it.

Can anyone help me, please?
 
An If...Else statement is one of the elementary building blocks of VB. I suggest that you find yourself a good beginner's tutorial and work your way through it get a good grasp of the basics first, before anything else. This is a good option:

Microsoft Visual Basic .NET tutorials for Beginners

Chapter 3 includes If statements.
 
Back
Top