Private Sub cmbKodePembayaran_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles cmbKodePembayaran.SelectedIndexChanged Select Case cmbKodePembayaran.SelectedItem Case "B-001" txtNamaPembayaran.Text = "Pembayaran Biaya Rawat Inap" txtBiaya.Text = 300000 Case "B-002" txtNamaPembayaran.Text = "Pembayaran Biaya Rawat Jalan" txtBiaya.Text = 100000 Case "B-003" txtNamaPembayaran.Text = "Pembayaran Obat" txtBiaya.Text = 50000 Case "B-004" txtNamaPembayaran.Text = "Biaya Administrasi " txtBiaya.Text = 30000 Case "B-005" txtNamaPembayaran.Text = "Biaya Dokter" txtBiaya.Text = 75000 End Select txtJumlah.Focus() End Sub Double Click txtJumlah dan ubah event menjadi keypress Private Sub txtJumlah_TextChanged(sender As System.Object, e As System.EventArgs) Handles txtJumlah.TextChanged
End Sub
Ubah event menjadi key_press
Private Sub txtJumlah_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles
txtJumlah.KeyPress If Asc(e.KeyChar) = 13 Then txttotal.Text = Val(txtBiaya.Text) * Val(txtJumlah.Text) If Val(txtJumlah.Text) >= 5 Then txtDiskon.Text = 0.03 * Val(txttotal.Text) Else txtDiskon.Text = 0 End If txtBayar.Focus() End If End Sub Tombol Hitung Private Sub BtnHitung_Click(sender As System.Object, e As System.EventArgs) Handles BtnHitung.Click txtKembali.Text = Val(txtBayar.Text) - (Val(txttotal.Text) - Val(txtDiskon.Text)) End Sub Tombol Ulang Private Sub BtnUlang_Click(sender As System.Object, e As System.EventArgs) Handles BtnUlang.Click txtNamaPasien.Clear() cmbKodePembayaran.Text = "--Pilih--" txtNamaPembayaran.Clear() txtBiaya.Clear() txtJumlah.Clear() txttotal.Clear() txtDiskon.Clear() txtBayar.Clear() txtKembali.Clear() txtNamaPasien.Focus() End Sub Tombol Tutup Private Sub BtnTutup_Click(sender As System.Object, e As System.EventArgs) Handles BtnTutup.Click Close() End Sub