New Post

Animasi Tulisan / Label di Visual basic / vb 6.0




  • Caption Form Muncul satu-satu
Const txt = " Animasi Text "

Dim p As Long

Private Sub Timer1_Timer()

p = p + 1

If p = 14 Then p = 0

Form1.Caption = Left(txt, p)

End Sub
 
* Interval Timer : 500 atau sesuai selera




·        Tulisan Berkedip

' ===> Animasi Text Berkedip 1 <=== '

Private Sub Timer1_Timer()

Label1.Visible = Not Label1.Visible

End Sub

* Interval Timer : 500 atau sesuai selera


===> Animasi Text Berkedip 2 <=== '
Private Sub Timer1_Timer()
If Label1.Visible = True Then
Label1.Visible = False
Label2.Visible = True
ElseIf Label1.Visible = False Then
Label1.Visible = True
Label2.Visible = False
End If
End Sub
* Interval Timer : 250 atau sesuai selera

  • Tulisan Ganti Warna

Dim Red, Green, Blue As Integer

Private Sub Timer1_Timer()

If Blue <= 255 Then

Blue = Blue + 50

Else

Blue = 0

Green = Green + 50

End If

If Green >= 255 Then

Green = 0

Red = Red + 50

End If

If Red >= 255 Then

Red = 0

End If

Label1.ForeColor = Int(RGB(Red, Green, Blue))

Label1.Refresh
 
atau seperti ini Dim warna As Long

Private Sub Timer1_Timer()

warna = warna + 5000

Label1.ForeColor = warna

End Sub
 
* Interval Timer : 100 atau sesuai selera


·         Tulisan Berjalan Ke Kiri

Private Sub Timer1_Timer()

Label1.Left = Label1.Left - 15

If Label1.Left < -Label1.Width Then

Label1.Left = Form1.Width ' ==> Form bisa diganti frame atau yang lain

End If

End Sub

* Interval Timer : 20 atau sesuai selera


·         Tulisan Berjalan Ke Atas


Private Sub Timer1_Timer()

Label1.Top = Label1.Top - 15

If Label1.Top <= -Label1.Top Then

JAtas.Top = Form1.Height ' ==> Form bisa diganti frame atau yang lain

End If

End Sub

* Interval Timer : 20 atau sesuai selera


·         Tulisan Berjalan Sepanjang Caption


Ke Kanan

Private Sub Timer1_Timer()

s$ = Label1.Caption

s$ = Right$(s$, 1) & Mid$(s$, 1, Len(s$) - 1)

Label1.Caption = s$

End Sub

Ke Kiri

Private Sub Timer2_Timer()

s$ = Label2.Caption

s$ = Mid$(s$, 2, Len(s$)) & Left$(s$, 1)

Label2.Caption = s$

End Sub

* Interval Timer : 100 atau sesuai selera

No comments