Download Program Case...Of Visual Basic 6.0
1. Buka Program Visual Basic 6.0
2. Desain Form seperti ini
3. Ubah Property
Form1 - Caption - Tampilkan Harga
Command1 - Name - CmdBersih
Caption - &BERSIH
Frame1 - Caption - MENU PILIHAN
Label1 - Caption - 1. Nasi Goreng
Label2 - Caption - 2. Bakso Urat
Label3 - Caption - 3. Gado-Gado
Label4 - Caption - 4. Soto Surabaya
Label5 - Caption - No. Pilihan :
Label6 - Caption - Harga Rp.
Text1 - Text - <Kosongkan>
Text2 - Text - <Kosongkan>
4. Copy code berikut dan Pastekan
- Klik Ganda Text1
Private Sub Text1_Change()
pilihan = Text1.Text
Select Case pilihan
Case 1: Text2.Text = "Rp 6000"
Case 2: Text2.Text = "Rp 5000"
Case 3: Text2.Text = "Rp 7000"
Case 4: Text2.Text = "Rp 10000"
Case Else: Text2.Text = "pilihan salah"
End Select
End Sub
- Klik Ganda Tombol Bersih
Private Sub CmdBersih_Click()
Text1.Text = ""
Text2.Text = ""
End Sub
5. Jalankan Program dengan Menekan F5 maka tampilannya akan seperti ini
Download Program Case...Of Visual Basic 6.0
No comments:
Post a Comment