martes, 13 de marzo de 2012

Visual studio 2010 " CREAR UN INVENTARIO"

Crear un inventario

Para ello crearemos:
11; Buttom
5; listbox
5;textbox
2; datetimepicker

ESTE PROGRAMA CONSISTE EN DIGITAR EN LOS TEXTBOX EL CODIGO ,DISTIBUCION DEL PRODUCTO y cada ves que lo digitememos oprimimos  DT para guardarlo en el listbox respectivo si queremos borrar oprimimos en el buttom


CUANDO DIGITEMOS  ,CANTIDAD"producto" Y  PRECIO UNITARIO"precio del producto"/ DAMOS EN EL BUTTON DE CANTIDAD*PRECIO para que nos de el resultado en el textbox de precio total  despues procedemos a darle DT para subirlo al listbox5 .


cuando tenga muchos TOTALES le damos en el buttom CALCULAR ara la suma de todos los numeros que se encuentren en el listbox5 el resultado lo mostrara en un msgbox.


Public Class Form1

Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
If ListBox5.SelectedIndex <> -1 Then

ListBox5.Items.RemoveAt(ListBox5.SelectedIndex)
Label5.Text = ListBox5.Items.Count & " "
Else

End If
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ListBox1.Items.Add(TextBox1.Text)
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
ListBox2.Items.Add(TextBox2.Text)
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
ListBox3.Items.Add(TextBox3.Text)
End Sub

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
ListBox4.Items.Add(TextBox4.Text)
End Sub

Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
ListBox5.Items.Add(TextBox5.Text)
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If ListBox1.SelectedIndex <> -1 Then

ListBox1.Items.RemoveAt(ListBox1.SelectedIndex)
Label1.Text = ListBox1.Items.Count & " "
Else

End If
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
If ListBox2.SelectedIndex <> -1 Then

ListBox2.Items.RemoveAt(ListBox2.SelectedIndex)
Label2.Text = ListBox2.Items.Count & " "
Else

End If
End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
If ListBox3.SelectedIndex <> -1 Then

ListBox3.Items.RemoveAt(ListBox3.SelectedIndex)
Label3.Text = ListBox3.Items.Count & " "
Else

End If
End Sub

Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
If ListBox4.SelectedIndex <> -1 Then

ListBox4.Items.RemoveAt(ListBox4.SelectedIndex)
Label4.Text = ListBox4.Items.Count & " "
Else

End If
End Sub

Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
TextBox5.Text = Val(TextBox3.Text) * Val(TextBox4.Text)

End Sub

Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
Dim suma As Integer

For Each elemento In ListBox5.Items

suma += elemento.ToString

Next

MessageBox.Show(suma)



End Sub
End Class


1 comentario: