Friday, January 2, 2009

Animasi Teks Berjalan 1






Bahan yang diperlukan, -:p
1. form

2. label


properties label bisa di custom sesuai selera ex font & font colour

3. timer

properties timer


4. coding, dibawah ini adalah contoh source code untuk membuat animasi teks berjalan di VB.Net/ Visual Basic 2008 :

Public Class Form1
'Sesuaikan array dengan banyaknya pesan !!'
Dim tulisan(3) As String
Dim i, j As Integer


'code ini diletakkan ditimer1 event tick'
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

If i.Equals(tulisan(j).Length) Then
Me.Label1.Text = ""
If j < tulisan.Length - 1 Then
j = j + 1
Me.Label1.Text = tulisan(j)
Else
j = 0
End If
i = 0
End If
Label1.Text = tulisan(j).Substring(0, i)
i = i + 1

End Sub


Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

'Masukkan pesan yang ingin ditampilkan disini
tulisan(0) = " Welcome to www.indofreak.blogspot.com "
tulisan(1) = " Thank's for coming and please come back any time "
tulisan(2) = " Happy Coding !!! ... "
tulisan(3) = " Waktu menunjukkan pukul : " & TimeValue(Date.Now) & " "

Label1.Text = tulisan(j)
End Sub

End Class


----- Code'It, Write'It, Share'It, Love'It -----
----------- IT Field It's My Passion -----------

Correct Me If I'am Wrong

No comments: