Public Class Form1
Dim i = 0
Dim re = True
Private Sub Timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer.Tick
If i = 225 Then
re = False
ElseIf i = 0 Then
re = True
End If
If re = True Then
i += i
ElseIf re = False Then
i -= i
End If
color1.BackColor = Color.FromArgb(i, i, i)
End Sub
End Class
在這段代碼中,我想從黑到白,然後從白到黑的標籤。 我設置了重新變量來表明它是否是白色,然後我會減少,直到顏色變黑。 =>不工作爲什麼這個代碼不工作
有時嘗試加密您的代碼。在函數的開頭放置一個斷點,並逐步完成它可能會讓你自己找到輸入錯誤。 – pascal 2010-07-22 06:09:16