Change color on value
Here's what I have but it does not work, what am I doing wrong?
Select Case ProgressBar1.Value
Case Is < 40
ProgressBar1.ForeColor = Color.Red
Case Is < 60
ProgressBar1.ForeColor = Color.Aqua
Case Is <= 94
ProgressBar1.ForeColor = Color.Blue
Case 95 To 100
ProgressBar1.ForeColor = Color.Green
End Select
[361 byte] By [
Whoisit] at [2007-12-22]
Thanks for the reply Moayad,
Here's the full sub
Private Sub BtnTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnTest.Click
'Just check that a password has been entered
Call Checkforpass()
'Function KeyQuality checks strength of password entered
Me.ProgressBar1.Value = KeyQuality(Me.TxtPass.Text)
LblPercent.Text = ("Password Strength = ") & Me.ProgressBar1.Value & (" %")
Select Case ProgressBar1.Value
Case Is < 40
ProgressBar1.ForeColor = Color.Red
LblStrength.Text = "Poor"
Case Is < 60
ProgressBar1.ForeColor = Color.Aqua
LblStrength.Text = "Average"
Case Is <= 94
ProgressBar1.ForeColor = Color.Blue
LblStrength.Text = "Good"
Case 95 To 100
ProgressBar1.ForeColor = Color.Green
LblStrength.Text = "Excellent"
End Select
LblPercent.Visible = True
End Sub
Yes, Key function works exactly as it should
What happens is the colour of the progress bar is always Green.
For future reference I've found out that, if you use the XP Theme progress bar stays Green, but if you change to the Classic Theme then the color changes to what ever forecolor you want, crazy or what?