Results 1 to 2 of 2

Thread: Vb.net **what Is Wrong With This Code**

  1. #1
    Join Date
    Nov 2011
    Posts
    1

    Vb.net **what Is Wrong With This Code**

    What is wrong with this code?

    When I enter the numbers into the text boxes in debug mode, nothing happens when I click "button1" form2 should show and msgbox should come up but it doesn't!

    here is my defective code:



    Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If T1.Text = "0" And T2.Text = "3" And T3.Text = "4" And T4.Text = "0" And T5.Text = "2" And T6.Text = "7" And T7.Text = "5" And T14.Text = "2" And T13.Text = "4" And T12.Text = "0" And T11.Text = "9" And T10.Text = "0" And T9.Text = "1" And T8.Text = "9" And T15.Text = "0" And T16.Text = "2" And T17.Text = "7" And T18.Text = "5" And T19.Text = "3" And T20.Text = "4" And T21.Text = "0" Then
    MsgBox("Login Successful!", MsgBoxStyle.Information)
    form2.show()
    End If

    End Sub

    Private Sub T1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T1.TextChanged
    If T1.TextLength = 1 Then
    T2.Select()
    End If
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    T1.Select()
    End Sub

    Private Sub T2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T2.TextChanged
    If T2.TextLength = 1 Then
    T3.Select()
    End If
    End Sub

    Private Sub T3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T3.TextChanged
    If T3.TextLength = 1 Then
    T4.Select()
    End If
    End Sub

    Private Sub T4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T4.TextChanged
    If T4.TextLength = 1 Then
    T5.Select()
    End If
    End Sub

    Private Sub T5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T5.TextChanged
    If T5.TextLength = 1 Then
    T6.Select()
    End If
    End Sub

    Private Sub T6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T6.TextChanged
    If T6.TextLength = 1 Then
    T7.Select()
    End If
    End Sub

    Private Sub T7_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T7.TextChanged
    If T7.TextLength = 1 Then
    T8.Select()
    End If

    End Sub

    Private Sub T8_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T8.TextChanged
    If T8.TextLength = 1 Then
    T9.Select()
    End If
    End Sub

    Private Sub T9_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T9.TextChanged
    If T9.TextLength = 1 Then
    T10.Select()
    End If
    End Sub

    Private Sub T10_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T10.TextChanged
    If T10.TextLength = 1 Then
    T11.Select()
    End If
    End Sub

    Private Sub T11_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T11.TextChanged
    If T11.TextLength = 1 Then
    T12.Select()
    End If
    End Sub

    Private Sub T12_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T12.TextChanged
    If T12.TextLength = 1 Then
    T13.Select()
    End If
    End Sub

    Private Sub T13_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T13.TextChanged
    If T13.TextLength = 1 Then
    T14.Select()
    End If
    End Sub

    Private Sub T14_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T14.TextChanged
    If T14.TextLength = 1 Then
    T15.Select()
    End If
    End Sub

    Private Sub T15_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T15.TextChanged
    If T15.TextLength = 1 Then
    T16.Select()
    End If
    End Sub

    Private Sub T16_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T16.TextChanged
    If T16.TextLength = 1 Then
    T17.Select()
    End If
    End Sub

    Private Sub T17_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T17.TextChanged
    If T17.TextLength = 1 Then
    T18.Select()
    End If
    End Sub

    Private Sub T18_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T18.TextChanged
    If T18.TextLength = 1 Then
    T19.Select()
    End If
    End Sub

    Private Sub T19_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T19.TextChanged
    If T19.TextLength = 1 Then
    T20.Select()
    End If
    End Sub

    Private Sub T20_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T20.TextChanged
    If T20.TextLength = 1 Then
    T21.Select()
    End If
    End Sub

    Private Sub T21_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T21.TextChanged
    If T21.TextLength = 1 Then
    Button1.Select()
    End If
    End Sub
    End Class

  2. #2
    Join Date
    May 2011
    Posts
    271

    Re: Vb.net **what Is Wrong With This Code**

    When you click on the button1 then does it shows you some error message or anything? If yes then please post that over here so that we can tell you where is the problem.

Similar Threads

  1. Replies: 1
    Last Post: 18-02-2012, 08:15 PM
  2. Apple sent me Wrong IMEI/Unlock Code for Iphone 4
    By GPower in forum Portable Devices
    Replies: 5
    Last Post: 27-12-2011, 02:29 PM
  3. Something is wrong with my C++ code. Plz help
    By Kev ave in forum Software Development
    Replies: 1
    Last Post: 27-10-2011, 02:39 PM
  4. Wrong Activation Code, activation issues
    By Lawford in forum Networking & Security
    Replies: 4
    Last Post: 11-04-2010, 12:41 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,723,836.75493 seconds with 17 queries