在部件工具条中选择“ProgressBar”
ProgressBar.Max = 100
ProgressBar.Min = 1
让ProgressBar.Value 的值等于从100 到 1,则血条从满到空
'一个简单且有效的办法添加两个label
让label1.BackColor=vbwhite
Label2.BackColor=vbred
两个CommandButton
示例代码如下:
Private
Sub
Command1_Click()
If
Label2.Width
>=
100
Then
Label2.Width
=
Label2.Width
-
100
If
Label2.Width
<
100
Then
Label2.Width
=
0
End
Sub
Private
Sub
Command2_Click()
If
Label2.Width
<
Label1.Width
Then
Label2.Width
=
Label2.Width
+
50
If
Label2.Width
>
Label1.Width
Then
Label2.Width
=
Label1.Width
End
Sub
1.用GetCursorPos取Mouse位置,然后用GetPixel取得血条位置颜色(血满的颜色).初始化2.设置Timer,用GetPixel检测血条颜色,如果颜色与血满颜色不匹配,则施放加血.
用Sendkeys摸按键
用Mouse_enent模拟Mouse点击.
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)