Private Sub cmdagregar_Click()
cmdborrar.Enabled = True
Listado.Col = 1
Listado.Row = fila
Listado.Text = txtcantidad.Text
Listado.Col = 2
Listado.Row = fila
Listado.Text = txtdetalle.Text
Listado.Col = 3
Listado.Row = fila
Listado.Text = txtprecio.Text
x = Val(txtcantidad.Text) * Val(txtprecio.Text)
Listado.Col = 4
Listado.Row = fila
Listado.Text = x
tot = tot + x
txttotal.Text = tot
fila = fila + 1
txtcantidad.Text = ""
txtdetalle.Text = ""
txtprecio.Text = ""
txtcantidad.SetFocus
End Sub
Private Sub cmdborrar_Click()
tot = tot - x
txttotal.Text = tot
fila = fila - 1
Listado.Col = 1
Listado.Row = fila
Listado.Text = ""
Listado.Col = 2
Listado.Row = fila
Listado.Text = ""
Listado.Col = 3
Listado.Row = fila
Listado.Text = ""
Listado.Col = 4
Listado.Row = fila
Listado.Text = ""
End Sub
Private Sub Form_Load()
Listado.ColWidth(0) = 10
Listado.Col = 1
Listado.Row = 0
Listado.Text = "CANTIDAD"
Listado.ColWidth(2) = 5000
Listado.ColAlignment(2) = 5
Listado.Col = 2
Listado.Row = 0
Listado.Text = "D E T A L L E"
Listado.ColWidth(3) = 1500
Listado.ColAlignment(3) = 5
Listado.Col = 3
Listado.Row = 0
Listado.Text = "PRECIO UNITARIO"
Listado.ColWidth(4) = 1300
Listado.ColAlignment(4) = 5
Listado.Col = 4
Listado.Row = 0
Listado.Text = "IMPORTE"
fila = 1
cmdborrar.Enabled = False
End Sub