Oleh: Dhidhin Haris | 6 Januari 2010

VB : Membuat Teks Berkedip

Pada tulisan kali ini, kita akan mencoba membuat efek berkedip pada teks yang ada pada control (label, textbox dan command button).

Berikut langkah-langkah pembuatannya :

Buat sebuah form dengan :

1 buah Label

1 buah Textbox

2 buat Command Button

1 buah Timer (set interval=200 dan enable=false)

Susun seperti gambar berikut :

Ketikkan program berikut di editor:

Dim status As Boolean
Private Sub Command2_Click()Timer1.Enabled = True
status = True
End Sub

Private Sub Timer1_Timer()
status = Not (status)
If status Then
Label1.Caption = “Teks Berkedip”
Text1.Text = “Teks Berkedip”
Command1.Caption = “Teks Berkedip”
Else
Label1.Caption = “”
Text1.Text = “”
Command1.Caption = “”
End If

End Sub

Jalankan program, hasilnya seperti gambar berikut :


Tinggalkan Balasan

Fill in your details below or click an icon to log in:

WordPress.com Logo

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

Twitter picture

You are commenting using your Twitter account. Log Out / Ubah )

Facebook photo

You are commenting using your Facebook account. Log Out / Ubah )

Connecting to %s

Kategori

Ikuti

Get every new post delivered to your Inbox.