Membuat Caption Label Mengetik Di Visual Basic 6.0
Untuk membuat caption pada label
mengetik, masukkan tiga buah komponen ke dalam form, yaitu label 1, biarkan
captionnya default, lalu command1 dengan caption “Play”, dan timer1 dengan
interval 300 dan enable “false”, setelah itu masuk pada jendela coding dan
ketikkan coding berikut :
Private Sub
Command1_Click()
If Command1.Caption
= "Play" Then
Timer1.Enabled =
True
Command1.Caption =
"Stop"
Else
Timer1.Enabled =
False
Command1.Caption =
"Play"
End If
End Sub
Private Sub
Form_Load()
Label1.Caption =
"B"
End Sub
Private Sub
Timer1_Timer()
Select Case Label1
Case "B"
Label1.Caption =
"BA"
Case "BA"
Label1.Caption =
"BAD"
Case "BAD"
Label1.Caption =
"BADS"
Case
"BADS"
Label1.Caption =
"BADSO"
Case
"BADSO"
Label1.Caption =
"BADSOF"
Case
"BADSOF"
Label1.Caption =
"BADSOFT"
Case
"BADSOFT"
Label1.Caption =
"BADSOFT "
Case "BADSOFT
"
Label1.Caption =
"BADSOFT C"
Case "BADSOFT
C"
Label1.Caption =
"BADSOFT CO"
Case "BADSOFT
CO"
Label1.Caption =
"BADSOFT COR"
Case "BADSOFT
COR"
Label1.Caption =
"BADSOFT CORP"
Case "BADSOFT
CORP"
Label1.Caption =
"BADSOFT CORPO"
Case "BADSOFT
CORPO"
Label1.Caption =
"BADSOFT CORPOR"
Case "BADSOFT
CORPOR"
Label1.Caption =
"BADSOFT CORPORA"
Case "BADSOFT
CORPORA"
Label1.Caption =
"BADSOFT CORPORAT"
Case "BADSOFT
CORPORAT"
Label1.Caption =
"BADSOFT CORPORATI"
Case "BADSOFT
CORPORATI"
Label1.Caption =
"BADSOFT CORPORATIO"
Case "BADSOFT
CORPORATIO"
Label1.Caption = "BADSOFT
CORPORATION"
Case "BADSOFT
CORPORATION"
Label1.Caption =
"B"
End Select
End Sub
Selanjutnya jalankan program (F5), dan click pada tombol
Play.
Labels: Pemrograman, Visual Basic 6.0
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home