表單設計 |
---|
![]() |
執行畫面 |
![]() |
Form1 : 調整表單視窗的大小,使Width和Height合乎適當大小。 Text1 : Text="0" Text2 : Text="100" Text3 : Text="" Command1: Caption="開始" Command2: Caption="停止" Command3: Caption="結束" Label1 : Caption="正數" Label2 : Caption="倒數" Label3 : Caption="現在時間" Timmer1 : Interval = 0 |
Public I, J, J0 As Single Private Sub Command1_Click() Timer1.Interval = 10 End Sub Private Sub Command2_Click() Timer1.Interval = 0 End Sub Private Sub Command3_Click() End End Sub Private Sub Form_Load() I = Val(Text1.Text) J = Val(Text2.Text) J0 = J End Sub Private Sub Timer1_Timer() Text3.Text = Time I = I + 1 If I > J0 Then I = 0 Text1.Text = I J = Val(Text2.Text) If J = 0 Then CRAZY If J < 0 Then J = J0 Text2.Text = J - 1 End Sub Sub CRAZY() Form1.WindowState = 2 For K = 1 To 100 Form1.BackColor = RGB(256 * Rnd, 256 * Rnd, 256 * Rnd) Next K Form1.WindowState = 0 End Sub |
|