0% found this document useful (0 votes)
27 views3 pages

Public Class Private Sub Byval As Byval As Handles Mybase: Form1

The document contains code for a form that allows a user to select a product from a dropdown, view its price and image, add multiple products to an order with quantities, and calculate subtotals, taxes, and totals. It initializes the dropdown with product options, displays price and image based on selection, adds selected items and quantities to lists with calculated line totals, and resets fields when finalizing an order.

Uploaded by

Marcela Mirada
Copyright
© Attribution Non-Commercial (BY-NC)
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)
27 views3 pages

Public Class Private Sub Byval As Byval As Handles Mybase: Form1

The document contains code for a form that allows a user to select a product from a dropdown, view its price and image, add multiple products to an order with quantities, and calculate subtotals, taxes, and totals. It initializes the dropdown with product options, displays price and image based on selection, adds selected items and quantities to lists with calculated line totals, and resets fields when finalizing an order.

Uploaded by

Marcela Mirada
Copyright
© Attribution Non-Commercial (BY-NC)
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/ 3

Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ComboBox1.Items.Add("Monitor LCD") ComboBox1.Items.

Add("Teclado") ComboBox1.Items.Add("Procesador I3") ComboBox1.Items.Add("Mouse") ComboBox1.Items.Add("CPU") End Sub Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged producto = ComboBox1.Text If producto = "Monitor LCD" Then precio = 500 PictureBox1.Image = PictureBox2.Image ElseIf producto = "Teclado" Then precio = 300 PictureBox1.Image = PictureBox3.Image ElseIf producto = "Procesador I3" Then precio = 800 PictureBox1.Image = PictureBox4.Image ElseIf producto = "Mouse" Then precio = 400 PictureBox1.Image = PictureBox5.Image ElseIf producto = "CPU" Then precio = 300 PictureBox1.Image = PictureBox6.Image End If TextBox5.Text = FormatCurrency(precio) End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click precio = CInt(TextBox5.Text) cant = NumericUpDown1.Value ListBox1.Items.Add(ComboBox1.Text) ListBox2.Items.Add(precio) ListBox3.Items.Add(cant) ListBox4.Items.Add(precio * cant) subtot = subtot + (precio * cant) igv = subtot * 0.18 total = subtot + igv TextBox6.Text = FormatCurrency(subtot) TextBox7.Text = FormatCurrency(igv) TextBox8.Text = FormatCurrency(total) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click precio = 0 : cant = 0 : subtot = 0 igv = 0 : total = 0 f = f + 1 TextBox3.Text = "F0000" & f TextBox4.Text = Date.Now TextBox1.Clear() TextBox2.Clear() TextBox5.Clear() TextBox6.Clear() TextBox7.Clear() TextBox8.Clear() ComboBox1.Text = "" NumericUpDown1.Value = 0 ListBox1.Items.Clear() ListBox2.Items.Clear() ListBox3.Items.Clear() ListBox4.Items.Clear() End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click If MsgBox("Cerrar Aplicacion..", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then End End If End Sub End Class

You might also like