Wordpress

Thermometer: code .NET


Als basis nemen we een ProgressBar. De code is deze:

Public Class thermometer

Public Property temperatuur() As Integer

Get

Return ProgressBar1.Value - 20

End Get

Set(ByVal value As Integer)

ProgressBar1.Value = value + 20

'Deze kleuren werken niet als Visual Styles aan staan
'zie dan http://support.microsoft.com/?scid=kb;EN-US;323088

If ProgressBar1.Value < 20 Then ProgressBar1.ForeColor = Color.White

If ProgressBar1.Value > 20 And ProgressBar1.Value < 20 Then ProgressBar1.ForeColor = Color.Blue

If ProgressBar1.Value >= 40 And ProgressBar1.Value < 30 Then ProgressBar1.ForeColor = Color.Yellow

If ProgressBar1.Value >= 50 Then ProgressBar1.ForeColor = Color.Red

End Set

End Property

End Class



Terug naar het project

[VBWeb index] - [Copyright]