vb程序小程序

来源:百度知道 编辑:UC知道 时间:2024/05/03 07:53:26
怎么将程序中的圆填充为实体????另外怎么让这个圆球左右晃动????
Private Sub Form_click()
Dim radius As Integer
ForeColor = &HFF0000
ScaleHeight = 100
ScaleWidth = 100
Circle (50, 50), 5
End Sub

Dim i%, j%

Private Sub Form_Click()
FillStyle = 0 '要加这个才可以填充颜色
ForeColor = &HFF0000
ScaleHeight = 100
ScaleWidth = 100
Timer1.Interval = 300
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
Cls
If i > 10 Then j = j - 2
If i < 10 Then j = j + 2
Circle (50 + j, 50), 5
If i = 20 Then i = 0
i = i + 1
End Sub

一个左右区间晃动的例子
Dim i%, m%, L As Boolean, R As Boolean
Dim isa As Boolean
Private Sub Form_Load()
i = 2000
m = 2000
L = True
End Sub
Private Sub Timer1_Timer()
If i > 3000 Then R = True: L = False'这里 可增大区间
If i < 1000 Then L = True: R = False
If R Then i = i - 50
If L Then i = i + 50
cR i, m
Me.Caption = i
End Sub
Sub cR(X%, Y%)
Cls
FillColor = QBColor(2)
FillStyle = 0 ' 选择随机的 FillStyle.
Cir