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

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

This document contains the code for a Visual Basic .NET Windows Forms application that allows a user to select products, enter quantities, and view subtotals in both dollars and soles. The form includes controls like a combo box for selecting a product, labels to display product details, numeric updowns for quantities, and lists to display order details. The code populates the combo box, handles selection changes to update product details, adds items to lists when the user clicks the add button, and allows removing items or closing the form.

Uploaded by

Eloy Macarlupu
Copyright
© © All Rights Reserved
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)
33 views3 pages

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

This document contains the code for a Visual Basic .NET Windows Forms application that allows a user to select products, enter quantities, and view subtotals in both dollars and soles. The form includes controls like a combo box for selecting a product, labels to display product details, numeric updowns for quantities, and lists to display order details. The code populates the combo box, handles selection changes to update product details, adds items to lists when the user clicks the add button, and allows removing items or closing the form.

Uploaded by

Eloy Macarlupu
Copyright
© © All Rights Reserved
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

Dim subtotal As Double


Dim dolares As Integer
Dim contar As Integer
Dim precio As Decimal

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
cboproducto.SelectedIndexChanged

precio = Val(Label10.Text)
Select Case cboproducto.SelectedIndex
Case 0
lblprecio.Text = Format("650", "currency")

Me.lbldesc.Text = "lcd21"
Case 1
Me.lblprecio.Text = Format("570", "currency")
Me.lbldesc.Text = "Mabe"
Case 2
lblprecio.Text = Format("123", "currency")

2:
Me.lbldesc.Text = "LG"
Case 3
lblprecio.Text = Format("485", "currency")
Me.lbldesc.Text = "Entrada de USB"
Case 4
lblprecio.Text = "187"
Me.lbldesc.Text = "Automatico"
Case 5
lblprecio.Text = "758"

Me.lbldesc.Text = "Capacidad 3k"

End Select

End Sub

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


System.EventArgs) Handles MyBase.Load

Me.lblfecha.Text = My.Computer.Clock.LocalTime.Date

With Me.cboproducto
.Items.Add("Televisor")
.Items.Add("refrigeradora")
.Items.Add("dvd")
.Items.Add("equipo")
.Items.Add("horno microonda")
.Items.Add("lavadora")
End With

End Sub

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


As System.EventArgs) Handles Button1.Click
If txtnom.Text = "" And txtapell.Text = "" And txttel.Text =
"" Then
MessageBox.Show("INGRESE LOS DATOSD", "ingrsesar datos",
MessageBoxButtons.YesNo)

Me.lstproduc.Items.Add(Me.cboproducto.SelectedItem)
Me.lstprecio.Items.Add(Me.Label10.Text)
Me.lstcant.Items.Add(Nudcantidad.Value)

subtotal = lblprecio.Text * Nudcantidad.Text


dolares = subtotal / 2.9
lstdolares.Items.Add(Format(dolares, "currency"))

Me.lstsoles.Items.Add(Format(subtotal, "currency"))
End If

End Sub

Private Sub TextBox3_TextChanged(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles txttel.TextChanged
If IsNumeric(txttel.Text) = True Then
Else
txttel.Clear()
End If
End Sub

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


As System.EventArgs) Handles Button2.Click
Try
Dim R As Integer
Me.lstproduc.Items.RemoveAt(R)
Me.lstprecio.Items.RemoveAt(R)
Me.lstcant.Items.RemoveAt(R)
Me.lstsoles.Items.RemoveAt(R)
Me.lstdolares.Items.RemoveAt(R)
Catch ex As Exception
MessageBox.Show("no hay nada")
End Try
End Sub

Private Sub Nudcantidad_ValueChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
Nudcantidad.ValueChanged
Nudcantidad.Maximum = 10
Nudcantidad.Minimum = 0

End Sub

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


As System.EventArgs) Handles Button3.Click
End
End Sub
End Class

You might also like