3 Replies - 597 Views - Last Post: 20 May 2008 - 07:18 PM Rate Topic: -----

#1 Warlox89  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 14-May 08

Error Display Bug?

Posted 20 May 2008 - 05:20 PM

Hello i'm making a login program, and I made a error display box which works but it just suddenly stopped working and idk why, it just doesn't work anymore when you fill out the password box but not the username box ..

Any idea's why?

Public Class Form1

    Private User As String
    Private Pass As String

    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Not TextBox1.Text = "" Then
            User = TextBox1.Text
            Label4.Text = ""
        Else
            Label4.Text = "Please input a username!"
        End If
        If Not TextBox2.Text = "" Then
            Pass = TextBox2.Text
            Label4.Text = ""
        Else
            If Not Label4.Text = "Please input a username!" Then
                Label4.Text = "Please input a password!"
            Else
                Label4.Text = "Please input a username, password!"
            End If
        End If
    End Sub
End Class


This post has been edited by Warlox89: 20 May 2008 - 05:21 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Error Display Bug?

#2 xtreampb  Icon User is offline

  • D.I.C Regular

Reputation: 12
  • View blog
  • Posts: 299
  • Joined: 20-June 07

Re: Error Display Bug?

Posted 20 May 2008 - 05:56 PM

I dont see any code that shows an error display box. you could use

if password ="" or name ="" then
messagebox.show("Pleese fill out completly")



or

do while name="" or password=""
messgebox.show("pleese fill out")
loop



or somthing like that.

This post has been edited by xtreampb: 20 May 2008 - 05:59 PM

Was This Post Helpful? 0
  • +
  • -

#3 ferrari12508  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3
  • View blog
  • Posts: 1,115
  • Joined: 02-November 07

Re: Error Display Bug?

Posted 20 May 2008 - 06:21 PM

Public Class Form1

    Private User As String
    Private Pass As String

    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Not TextBox1.Text = "" Then
            User = TextBox1.Text
            Label4.Text = ""
        Else
            Label4.Text = "Please input a username!"
        End If
        If Not TextBox2.Text = "" Then
            Pass = TextBox2.Text
        Else
            If Not Label4.Text = "Please input a username!" Then
                Label4.Text = "Please input a password!"
            Else
                Label4.Text = "Please input a username, password!"
            End If
        End If
    End Sub
End Class


Try that. when you cleared label4 in the second if statement, it made the username check pointless as the label was empty
Was This Post Helpful? 0
  • +
  • -

#4 Warlox89  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 14-May 08

Re: Error Display Bug?

Posted 20 May 2008 - 07:18 PM

View Postferrari12508, on 20 May, 2008 - 08:21 PM, said:

Public Class Form1

    Private User As String
    Private Pass As String

    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Not TextBox1.Text = "" Then
            User = TextBox1.Text
            Label4.Text = ""
        Else
            Label4.Text = "Please input a username!"
        End If
        If Not TextBox2.Text = "" Then
            Pass = TextBox2.Text
        Else
            If Not Label4.Text = "Please input a username!" Then
                Label4.Text = "Please input a password!"
            Else
                Label4.Text = "Please input a username, password!"
            End If
        End If
    End Sub
End Class


Try that. when you cleared label4 in the second if statement, it made the username check pointless as the label was empty


Thanks that worked :) sorry im new to VB.net so I made a nub mistake :P
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1