You are on page 1of 2

VENTAS DE PIEL

Public Class Form1

Sub resultados()
Dim j As Integer
Dim subto, iva, tot As Single
subto = 0
For j = 0 To ListBox5.Items.Count - 1
subto = subto + Val(ListBox5.Items(j))
Next
iva = subto * 0.16
tot = subto + iva
TextBox6.Text = Format(subto, "$##,##.00")
TextBox7.Text = Format(iva, "$##,##.00")
TextBox8.Text = Format(tot, "$##,##.00")
End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load


Button2.Enabled = False
Button3.Enabled = False
TextBox6.Enabled = False
TextBox7.Enabled = False
TextBox8.Enabled = False
ListBox2.Enabled = False
ListBox3.Enabled = False
ListBox4.Enabled = False
ListBox5.Enabled = False
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim prec, uni, impor As Single
prec = Val(TextBox4.Text)
uni = Val(TextBox5.Text)
impor = prec * uni
ListBox1.Items.Add(TextBox1.Text)
ListBox2.Items.Add(TextBox2.Text)
ListBox3.Items.Add(prec)
ListBox4.Items.Add(uni)
ListBox5.Items.Add(impor)
Call resultados()
Button2.Enabled = True
Button3.Enabled = True
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox1.Focus()
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click


Dim index As Integer
index = ListBox1.SelectedIndex
ListBox1.Items.RemoveAt(index)
ListBox2.Items.RemoveAt(index)
ListBox3.Items.RemoveAt(index)
ListBox4.Items.RemoveAt(index)
ListBox5.Items.RemoveAt(index)
Call resultados()
TextBox1.Focus()
End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click


Dim resp As MsgBoxResult
resp = MsgBox("Desea salir", MsgBoxStyle.YesNo, "Salida")
If resp = MsgBoxResult.Yes Then
Me.Close()
End If
End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click


Button2.Enabled = False
Button3.Enabled = False
ListBox1.Items.Clear()
ListBox2.Items.Clear()
ListBox3.Items.Clear()
ListBox4.Items.Clear()
ListBox5.Items.Clear()
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
TextBox7.Clear()
TextBox8.Clear()
TextBox1.Focus()
End Sub
End Class

Related Interests