Tugas 1

Saat form dijalankan : semua isian tidak aktif, tombol isi data dan tutup aktif, tombol clear tidak aktif
- Saat ditekan tombol isi data : kodebarang, jumlahbarang, cara beli, tombol clear, aktif, tombol isidata tidak aktif
- Saat ditekan combol clear sama dengan saat form dijalankan.
Ubah Coding pada Program IF dan CASE :
- Coding Form seperti di bawah ini :
Dim control As Windows.Forms.Control
For Each control In Me.Controls
control.Enabled = False
Button3.Enabled = True
Button2.Enabled = True
Next
cmbkode.Items.Add(“SND”)
cmbkode.Items.Add(“TST”)
cmbkode.Items.Add(“TOP”)
cmbkode.Items.Add(“TAS”)
- Kemudian ubah coding pada button Clear dengan :
Dim control As Windows.Forms.Control
For Each control In Me.Controls
control.Enabled = False
Button3.Enabled = True
Button2.Enabled = True
Next
txtnama.Clear()
txtbayar.Clear()
txtdiskon.Clear()
txtharga.Clear()
txtjumlah.Clear()
txttotal.Clear()
Me.radiotunai.Checked = False
Me.radiokredit.Checked = False
cmbkode.Text = “”
- Lalu button Isi Data di isi dengan listing di bawah ini :
For Each control In Me.Controls
control.Enabled = True
Button3.Enabled = False
Next
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If MsgBox(“Apakah anda akan keluar ?”,
vbYesNo + vbQuestion + vbDefaultButton2, “Keluar”) = vbYes Then
End If
Me.Close()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim control As Windows.Forms.Control
For Each control In Me.Controls
control.Enabled = True
Button3.Enabled = False
Next
End Sub
End Class
Tugas 2
Langsung ke Permasalahannya :
- Buat 1 form dan 9 Button, dengan Name Button: btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8, dan btn9.
- Ubah Text Form1: Puzzle, dan ubah Text masing-masing button dari btn1: 1 seterusnya sampai btn8: 8. Untuk btn9 tidak diberi Text (kosong).
- Form dijalankan pada posisi angka normal, seperti gambar dibawah ini:

Encoding :





No comments:
Post a Comment