请问你的I值是否初始化?在DIAOYONG过程中I值为0还有S定义为整形,但是用在那里了? :)

解决方案 »

  1.   

    控制颜色的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
      

  2.   

    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
      

  3.   

    rnd函数第一次出现的值好象都一样!
      

  4.   

    i值域明显不对,换全局的试一下,或者在diaoyong时传输i变量
      

  5.   

    换成private i,j as integer