控制颜色的r,g,b三次调用没有变化,只是画了三个同样颜色的圆。 Dim i As Integer, j As Integer For i = 1 To 3 Step 1Call diaoyong(i)
Next iEnd SubPrivate Sub diaoyong(int j) Dim xpos As Integer, ypos As Integer Dim limit As Integer, radius As Integer Dim r As Integer, g As Integer, b As Integerr = 255 * Rnd g = 255 * Rnd b = 255 * Rnd Select Case j Case 1 r=0 Case 2 g=0 Case 3 b=0End Selectxpos = ScaleWidth * j / 3 ypos = ScaleHeight / 2 limit = 1500 For radius = 0 To limit Circle (xpos, ypos), radius, RGB(r, g, b) Next radius Dim h As Integer, s As Integer For h = 1 To 10000 h = h + 1 Next h End Sub
Dim i As Integer, j As IntegerPrivate Sub form_click()For i = 1 To 3 Step 1 j = i Select Case j Case 1 Call diaoyong Case 2 Call diaoyong Case 3 Call diaoyong End SelectNext iEnd SubPrivate Sub diaoyong() Dim xpos As Integer, ypos As Integer Dim limit As Integer, radius As Integer Dim r As Integer, g As Integer, b As Integerr = 255 * Rnd g = 255 * Rnd b = 255 * Rndxpos = ScaleWidth * i / 3 ypos = ScaleHeight / 2 limit = 1500 For radius = 0 To limit Circle (xpos, ypos), radius, RGB(r, g, b) Next radius Dim h As Integer, s As Integer For h = 1 To 10000 h = h + 1 Next h End Sub或者 Private Sub form_click()Dim i As Integer, j As Integer For i = 1 To 3 Step 1 j = i Select Case j Case 1 Call diaoyong(j) Case 2 Call diaoyong(j) Case 3 Call diaoyong(j) End SelectNext iEnd SubPrivate Sub diaoyong(byval i as integer) Dim xpos As Integer, ypos As Integer Dim limit As Integer, radius As Integer Dim r As Integer, g As Integer, b As Integerr = 255 * Rnd g = 255 * Rnd b = 255 * Rndxpos = ScaleWidth * i / 3 ypos = ScaleHeight / 2 limit = 1500 For radius = 0 To limit Circle (xpos, ypos), radius, RGB(r, g, b) Next radius Dim h As Integer, s As Integer For h = 1 To 10000 h = h + 1 Next h End Sub
Dim i As Integer, j As Integer
For i = 1 To 3 Step 1Call diaoyong(i)
Next iEnd SubPrivate Sub diaoyong(int j)
Dim xpos As Integer, ypos As Integer
Dim limit As Integer, radius As Integer
Dim r As Integer, g As Integer, b As Integerr = 255 * Rnd
g = 255 * Rnd
b = 255 * Rnd
Select Case j
Case 1
r=0
Case 2
g=0
Case 3
b=0End Selectxpos = ScaleWidth * j / 3
ypos = ScaleHeight / 2
limit = 1500
For radius = 0 To limit
Circle (xpos, ypos), radius, RGB(r, g, b)
Next radius
Dim h As Integer, s As Integer
For h = 1 To 10000
h = h + 1
Next h
End Sub
j = i
Select Case j
Case 1
Call diaoyong
Case 2
Call diaoyong
Case 3
Call diaoyong
End SelectNext iEnd SubPrivate Sub diaoyong()
Dim xpos As Integer, ypos As Integer
Dim limit As Integer, radius As Integer
Dim r As Integer, g As Integer, b As Integerr = 255 * Rnd
g = 255 * Rnd
b = 255 * Rndxpos = ScaleWidth * i / 3
ypos = ScaleHeight / 2
limit = 1500
For radius = 0 To limit
Circle (xpos, ypos), radius, RGB(r, g, b)
Next radius
Dim h As Integer, s As Integer
For h = 1 To 10000
h = h + 1
Next h
End Sub或者
Private Sub form_click()Dim i As Integer, j As Integer
For i = 1 To 3 Step 1
j = i
Select Case j
Case 1
Call diaoyong(j)
Case 2
Call diaoyong(j)
Case 3
Call diaoyong(j)
End SelectNext iEnd SubPrivate Sub diaoyong(byval i as integer)
Dim xpos As Integer, ypos As Integer
Dim limit As Integer, radius As Integer
Dim r As Integer, g As Integer, b As Integerr = 255 * Rnd
g = 255 * Rnd
b = 255 * Rndxpos = ScaleWidth * i / 3
ypos = ScaleHeight / 2
limit = 1500
For radius = 0 To limit
Circle (xpos, ypos), radius, RGB(r, g, b)
Next radius
Dim h As Integer, s As Integer
For h = 1 To 10000
h = h + 1
Next h
End Sub