Two thing I would like to know?

Discussion in 'Programming & Scripting' started by lazyazzz12, Aug 6, 2009 with 4 replies and 233 views.

  1. lazyazzz12

    lazyazzz12 Enthusiast

    Messages:
    152
    Ratings:
    11
    First
    I would like to know how to make a MsgBox pop up when a progress bar reaches the end.
    Second
    Ok I have a picturebox and i want a msgbox to come up saing "login failed" whenever there is an errorimage and i want a msgbox to come up saing "login success" if the image loads normally

     
  2. Ibdc

    Ibdc Retired Retired

    Messages:
    5,100
    Ratings:
    2,072
    Code:
    ProgressBar1.Minimum = 1
    ProgressBar1.Maximum = 10
    For i As Integer = 1 To 9
    ProgressBar1.Value += 1
    Next
    If ProgressBar1.Value = 10 Then
    MessageBox.Show("loading done")
    End If
    Just use a try catch for the image log in thing

    Try
    'code to login
    Catch Ex as Exception
    Messagebox.Show("Login Failed")
    End Try
     
  3. OP
    lazyazzz12

    lazyazzz12 Enthusiast

    Messages:
    152
    Ratings:
    11
    the progressbar thing worked now the code for the button on the picture thing and it is not valid ya how do i fix it
    Code:
     
    Try
    Catch ex As Exception When PictureBox1.ErrorImage = true
    MessageBox.Show("login Failed")
    End Try
    Try
    Catch ex As Exception When PictureBox1.visable = true
    MessageBox.Show("login Success")
    End Try
    
     
  4. Ibdc

    Ibdc Retired Retired

    Messages:
    5,100
    Ratings:
    2,072
    It's invalid because that made no sense.
    Code:
    Try ' do nothing to this line
    ' put the code here to do whatever you're doing like make a picturebox an iamge
    Catch ex As Exception ' do nothing to this line
    'this line is where you put code for something to happen if it fails
    End Try ' do nothing to this line
    
     
    • Like Like x 1
  5. OP
    lazyazzz12

    lazyazzz12 Enthusiast

    Messages:
    152
    Ratings:
    11
    Thanks it worked BTW you are an extremely helpful member and have been there to help me with everything programing thanks :wink:
     

Share This Page