Tips And Trick Animasi Form VB


Contoh berikut akan memperlihatkan beberapa macam bentuk animasi form sederhana
Code: Select all
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

About willyfavindy

Aku seorang yang sangat menggemari teknologi komputer dan mengikuti perkembangan zaman di saat ini

Posted on Mei 27, 2008, in Tips And Trick Animasi Form, Tips dan trik. Bookmark the permalink. 3 Komentar.

  1. tengkyu bgt bang tp contoh 2 n contoh 5 ko blm jalan knp ya..

  2. hahaha juga😀 woke bang matur tengkyu lagi yaw hehehe…

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: