DS控件库 一个简单的血条颜色渐变方案
程序员文章站
2022-04-07 08:42:10
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(... ......
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
上一篇: SEO:热门词简单优化技巧