;
;

Rabu, 02 Desember 2009

Trik Animasi Form

Posted on 23.53 by AssLab Community


Contoh berikut akan memperlihatkan beberapa macam bentuk animasi form sederhana

Anda cukup copy paste per-contoh untuk mencoba script ini...
Contoh 1:

Private Sub Form_Unload(Cancel As Integer)
Me.BackColor = vbWhite ' warna belakang putih
WindowState = 2 ' maximized-kan
DrawWidth = 4 '/ ketebalan
For i = 1 To 16000
   Bawah = Bawah + 1
   Kanan = Kanan + 1
   PSet (Rnd * Kanan, Rnd * Bawah), QBColor(Rnd * 15)
Next i
End Sub


Contoh 2:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
cepat = 150
While Left + Width < Screen.Width
    DoEvents
    Left = Left + cepat
Wend
While Top - Height < Screen.Height
    DoEvents
    Top = Top + cepat
Wend
Hide
End Sub


Contoh 3:
Private Sub Timer1_Timer()
Dim LingkaranX, LingkaranY, Radius
    ScaleMode = 3
    LingkaranX = ScaleWidth / 2
    LingkaranY = ScaleHeight / 2
    For Radius = 0 To 100
        Circle (LingkaranX + Radius / 2, LingkaranY), Radius, RGB(Rnd * 215, Rnd * 55, Rnd * 15)
    Next Radius
End Sub


Contoh 4:
Private Sub Form_Load()
Me.AutoRedraw = True
BackColor = 0
For i = 1 To 500
  CurrentX = i * 100
  CurrentY = i * 100
  h = h & i
  ForeColor = i * 10000
  Print h
Next i
End Sub


Contoh 5:
Private Sub Form_Load()
Me.AutoRedraw = True
Me.DrawWidth = 10
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Form_MouseMove 1, 0, X, Y
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Caption = "PosisiX=" & X & " - " & "PosisiY=" & Y
If Button = 1 Then
   PSet (X, Y), vbBlue
End If
End Sub

No Response to "Trik Animasi Form"

Leave A Reply