Trik Kali ini adalah cara untuk membuat Marquee. Langsung Saja mulai membuat Project Baru, dan sebuah form dengan komponen
Object | Properties | |
Form1 | Name | FrmMarquee |
FormBorderStyle | FixedSingle | |
Text | Marquee | |
Timer1 | Enabled | True |
Interval | 1 | |
Textbox1 | Name | TxtKata |
Text | ||
Label1 | Name | LblKata |
Text | ||
FontSize | 18px |
Setelah Itu Masukanlah Kode berikut pada
Public Class FrmMarquee
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles TxtKata.TextChanged
'Menyamakan Isi Label dengan Isi Text
LblKata.Text = TxtKata.Text
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Timer1.Tick
'Lebar Form Untuk Menentukan Titik Mulai Marquee
Dim LebarForm As Integer = Me.Width
Dim LebarLabel As Integer = LblKata.Width
'MaxKiri Untuk Menentukan titik Akhir Maruquee
Dim MaxKiri As Integer = LebarLabel * -1
If LblKata.Left < MaxKiri Then
LblKata.Left = LebarForm
Else
LblKata.Left -= 1
End If
End Sub
End Class
1 komentar:
Tengkyu gan, sudah membantu saya. :)
www.teknosian.blogspot.com
Posting Komentar