Kamis, 03 Mei 2012

Membuat Games Sederhana Dengan Visual Basic 6.0



//Listing

Private Sub Command1_Click()
a = Int(Rnd * 10)
Text2.Text = a
Text1.SetFocus
If Text2.Text = Text1.Text Then
Label1.Caption = "Tebakan Anda Benar"
MsgBox "Jactpot", VbOnly + vbInformation, "Hasil"
Else
Label1.Caption = "Anda Salah"
MsgBox "Try Again", vbExclamation, "Hasil"
End If
End Sub

Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Form_Load()
Label2.Caption = "Masukkan Angka 0-9"
Text1.Text = ""
Text2.Text = ""
Command1.Caption = "Enter"
Command2.Caption = "Clear"
Command3.Caption = "Exit"
Label1.Caption = ""
End Sub

Private Sub Timer1_Timer()
Label2.ForeColor = QBColor(Rnd * 15)
Label1.BackColor = QBColor(Rnd * 15)
End Sub

Tidak ada komentar:

Posting Komentar

Membuat Games Sederhana Dengan Visual Basic 6.0



//Listing

Private Sub Command1_Click()
a = Int(Rnd * 10)
Text2.Text = a
Text1.SetFocus
If Text2.Text = Text1.Text Then
Label1.Caption = "Tebakan Anda Benar"
MsgBox "Jactpot", VbOnly + vbInformation, "Hasil"
Else
Label1.Caption = "Anda Salah"
MsgBox "Try Again", vbExclamation, "Hasil"
End If
End Sub

Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Form_Load()
Label2.Caption = "Masukkan Angka 0-9"
Text1.Text = ""
Text2.Text = ""
Command1.Caption = "Enter"
Command2.Caption = "Clear"
Command3.Caption = "Exit"
Label1.Caption = ""
End Sub

Private Sub Timer1_Timer()
Label2.ForeColor = QBColor(Rnd * 15)
Label1.BackColor = QBColor(Rnd * 15)
End Sub

Tidak ada komentar:

Posting Komentar