0% found this document useful (0 votes)
35 views4 pages

Form1: "Piston" "Bohlam Sein" "Kabel Rem"

The document contains the code for a Windows Forms application in Visual Basic. It defines various event handler subroutines for controls on a form such as buttons, text boxes, combo boxes and radio buttons. The event handlers handle actions like populating text boxes based on combo box selection, calculating totals and discounts, and clearing fields. The form and controls are used to manage data for a purchase transaction.

Uploaded by

Astri Rizki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views4 pages

Form1: "Piston" "Bohlam Sein" "Kabel Rem"

The document contains the code for a Windows Forms application in Visual Basic. It defines various event handler subroutines for controls on a form such as buttons, text boxes, combo boxes and radio buttons. The event handlers handle actions like populating text boxes based on combo box selection, calculating totals and discounts, and clearing fields. The form and controls are used to manage data for a purchase transaction.

Uploaded by

Astri Rizki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Public Class Form1

keluar
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
End
End Sub

Private Sub TextBox8_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles ebelanja.TextChanged

End Sub

barang
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles cb1.SelectedIndexChanged
If cb1.Text = "piston" Then
esatuan.Text = 200000
Else If cb1.Text = "bohlam sein" Then
esatuan.Text = 50000
Else If cb1.Text = "kabel rem" Then
esatuan.Text = 30000

Else
cb1.Text = 0
End If

End Sub

Private Sub esatuan_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles esatuan.TextChanged

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load

End Sub

baru
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
enota.Text = ""
enama.Text = ""
ekota.Text = ""
esatuan.Text = "0"
ebeli.Text = "0"
ebelanja.Text = "0"
ediskon.Text = "0"
etotal.Text = "0"
ekonsumen.Text = "0"
epengembalian.Text = "0"
cb1.Text = ""
rb1.Text = ""
rb2.Text = ""
enota.Focus()
End Sub

beli
Private Sub ebeli_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ebeli.TextChanged
ebelanja.Text = esatuan.Text * ebeli.Text
End Sub

member
Private Sub rb1_CheckedChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Dim jus As Integer
Dim diskon As Integer

jus = CInt(esatuan.Text)

diskon = (jus * 0.1)


ediskon.Text = "" & diskon
End Sub

Private Sub rb2_CheckedChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs)

End Sub

diskon
Private Sub ediskon_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ediskon.TextChanged
Dim jumlah As Integer
Dim diskon As Integer
Dim total As Integer

jumlah = CInt(ebelanja.Text)
diskon = CInt(ediskon.Text)

total = (jumlah - diskon)


etotal.Text = "" & total
End Sub

umum
Private Sub rb2_CheckedChanged_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles rb2.CheckedChanged
Dim jusa As Integer
Dim diskon As Integer

jusa = CInt(esatuan.Text)

diskon = (jusa * 0)
ediskon.Text = "" & diskon
End Sub

Uang konsumen
Private Sub ekonsumen_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ekonsumen.TextChanged
epengembalian.Text = ekonsumen.Text - etotal.Text
End Sub

member
Private Sub rb1_CheckedChanged_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles rb1.CheckedChanged
Dim jusa As Integer
Dim diskon As Integer

jusa = CInt(esatuan.Text)

diskon = (jusa * 0.1)


ediskon.Text = "" & diskon
End Sub
End Class

You might also like