0% found this document useful (0 votes)
36 views

Public Class Private Sub Byval As Byval As Handles Dim As Double

This code handles button click events to calculate order totals. It totals the prices of selected checkboxes, applies a 10% discount if paid in full, and displays subtotals and totals in local or US currency depending on the selected radio button. Values for total, discount, and amount due are output to textboxes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Public Class Private Sub Byval As Byval As Handles Dim As Double

This code handles button click events to calculate order totals. It totals the prices of selected checkboxes, applies a 10% discount if paid in full, and displays subtotals and totals in local or US currency depending on the selected radio button. Values for total, discount, and amount due are output to textboxes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Public Class Form3

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


As System.EventArgs) Handles Button1.Click
Dim desc, monto, cont As Double
desc = 0
cont = 0
monto = 0

If CheckBox1.Checked Then
monto += 1800
cont += 1
End If
If CheckBox2.Checked Then
monto += 50
cont += 1
End If
If CheckBox3.Checked Then
monto += 250
cont += 1
End If
If CheckBox4.Checked Then
monto += 150
cont += 1
End If
TextBox1.Text = cont
'Tipo de cambio: US$ 1 = S/ 3
If RadioButton1.Checked Then
desc = monto * 0.1
End If
'Si el pago es el contado el Descuento asciende al 10%
If RadioButton4.Checked Then
Label2.Text = "Monto US$:"
Label3.Text = "Descuento US$:"
Label4.Text = "Total a Pagar US$:"
TextBox2.Text = monto
TextBox3.Text = desc
Else
Label2.Text = "Monto S/:"
Label3.Text = "Descuento S/:"
Label4.Text = "Total a Pagar S/:"
TextBox2.Text = monto * 3
TextBox3.Text = desc * 3
End If
TextBox4.Text = TextBox2.Text - TextBox3.Text
End Sub
End Class

You might also like