What's new

Two thing I would like to know?

  • Thread starter lazyazzz12
  • Start date
  • Views 327
lazyazzz12

lazyazzz12

Enthusiast
Messages
151
Reaction score
11
Points
70
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
 
Ibdc

Ibdc

VIP
VIP
Retired
Forum Addict MotM
Messages
4,969
Reaction score
2,193
Points
625
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
 
lazyazzz12

lazyazzz12

Enthusiast
Messages
151
Reaction score
11
Points
70
Ibdc said:
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
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
 
Ibdc

Ibdc

VIP
VIP
Retired
Forum Addict MotM
Messages
4,969
Reaction score
2,193
Points
625
lazyazzz12 said:
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
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
 
lazyazzz12

lazyazzz12

Enthusiast
Messages
151
Reaction score
11
Points
70
Ibdc said:
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

Thanks it worked BTW you are an extremely helpful member and have been there to help me with everything programing thanks :wink:
 
Top Bottom
Login
Register