Sunday, April 4, 2010

VB6 Code - Animasi Ketikan Tanpa Flicker

Fungsi VB6 di bawah ini digunakan untuk animasi yang menyerupai text yang sedang di ketik. Animasinya sangat halus nyaris tanpa kedipan.
Option Explicit

Dim sAnimation As String

Private Sub Form_Load()
sAnimation = "Asep Hibban : http://4basic-vb.blogspot.com"
End Sub

Private Sub Timer1_Timer()
Dim sToAnimate As String
Static iAnimation As Integer
Dim c As Integer
iAnimation = iAnimation + 1

sToAnimate = Mid(sAnimation, 1, iAnimation)
With Picture1
.Cls
.CurrentX = 25
.CurrentY = 100
Picture1.Print sToAnimate
End With
If iAnimation >= Len(sAnimation) Then
iAnimation = 0
End If
End Sub