You are on page 1of 4

Public Class Form1

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

cboProducto.Items.Add("camisa")
cboProducto.Items.Add("chumpa")

cboTalla.Items.Add("Pequeño")
cboTalla.Items.Add("Mediano")
cboTalla.Items.Add("Grande")

cboColor.Items.Add("Amarillo")
cboColor.Items.Add("Rojo")
cboColor.Items.Add("Blanco")
cboColor.Items.Add("Verde")

End Sub

Private Sub cboTalla_SelectedIndexChanged(sender As Object, e As EventArgs)


Handles cboTalla.SelectedIndexChanged
Select Case cboTalla.SelectedIndex
Case 0

If cboProducto.Text = "camisa" Then


Precio = 100
Else
If cboProducto.Text = "chumpa" Then
Precio = 250.99
End If
End If

Case 1

If cboProducto.Text = "camisa" Then


Precio = 125.99
Else
If cboProducto.Text = "chumpa" Then
Precio = 300.9
End If
End If

Case 2

If cboProducto.Text = "camisa" Then


Precio = 175.9
Else
If cboProducto.Text = "chumpa" Then
Precio = 450.0
End If
End If
End Select

End Sub

Private Sub btnAgregar_Click(sender As Object, e As EventArgs) Handles


btnAgregar.Click, Button2.Click, Button1.Click
Dim i As Byte

DataGridView1.Rows.Clear()

For i = 0 To 9

If total(i) <> Nothing Then


DataGridView1.Rows.Add(cboProducto.Text, cboTalla.Text,
cboColor.Text, Precio)
Else
Exit For
End If
Next i
End Sub
End Class
Module Programacion

Public Precio As Double


Public camisa(10) As Double
Public talla(10) As Double
Public color(10) As Double
Public total(10) As Double

Public Pagototal As Double

Sub limpiar_vectores()

Dim i As Byte

For i = 0 To 9
camisa(i) = Nothing
talla(i) = Nothing
color(i) = Nothing

Next i

Form1.DataGridView1.Rows.Clear()

End Sub

End Module

You might also like