DS控件库 一个简单的血条颜色渐变方案
Private Sub DS按钮1_ButtonClick(Sender As Object) Handles DS按钮1.ButtonClick Dim T As New Threading.Thread(AddressOf Doit) T.IsBackground = True T.Start() End Sub Private Sub Doit() For I As Integer = 1000 To 0 Step -1 DS进度条1.当前值 = I Dim Cl As Color = Color.FromArgb(255 * (1 - I / 1000), 255 * (I / 1000), 0) DS进度条1.前景颜色 = Cl DS标签1.Text = "<color=255,200,0>HP</color> " & I Threading.Thread.Sleep(10) Application.DoEvents() Next DS进度条1.当前值 = 0 DS标签1.Text = "<color=255,200,0>HP</color> 0" End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load CheckForIllegalCrossThreadCalls = False End Sub