.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> Visual Studio >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

BOOK SHOP

Posted By:SanthoshNathan       Posted Date: November 28, 2010    Points: 15    Category: Visual Studio    URL: http://www.dotnetspark.com  

BOOK SHOP
 

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
                                 System.EventArgs) Handles Button1.Click
        If TextBox1.Text = "rob" And TextBox2.Text = "123" Then
            Form2.Show()
        ElseIf TextBox1.Text = "ray" And TextBox2.Text = "122" Then
            Form2.Show()
        ElseIf TextBox1.Text = "" And TextBox2.Text = "123" Then
            MessageBox.Show("Enter the username")
        ElseIf TextBox1.Text = "rob" And TextBox2.Text = "" Then
            MessageBox.Show("Enter the password")
        ElseIf TextBox1.Text = "" And TextBox2.Text = "" Then
            MessageBox.Show("Enter the username and password")
        Else
            MessageBox.Show("invalid login")
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object,
               ByVal e As System.EventArgs) Handles Button2.Click
        TextBox1.Clear()
        TextBox2.Clear()
    End Sub

End Class

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend