Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Formularios vb new

170 views

Published on

formularios

Published in: Business
  • Be the first to comment

  • Be the first to like this

Formularios vb new

  1. 1. no formularios - Microsoft Visual Studio File Edit View Project Build Debug Team Data Format Tools Test Window Help '4 . . . ':': tl: *2.'_ E All Wm $3 4 Comm E K : § Regtstro de Alumnos .5 “B5 A A I; u. i H, u. n. v R « .
  2. 2. no formularios - Microsoft Visual Studio File Edit View Project Build Debug Team Data Tools Test Window Help ' I . 5 p _ _ . :': tl: *2t ; ‘%Pub11c Class -cc": Gene” § Dim arrNombre(15) As String Dim arrEdad(15) As Integer : Dim arrSexo(15) As String 5 Dim intlndice As Integer = -1 . ‘9' =5 — Private Sub Button2_C1ick(ByVal sender As System. C If intlndice < 15 Then intlndice += 1 ' ct, ByVal e As System. Exent$“gs) Handles Button2.Click arrNombre(intIndice) = txtnombre. Text arrEdad(intIndice) = NumericUpDown1.Va1ue arrSexo(intIndice) = ComboBox1.SelectedItem ListBox1.Items. Add(arrNombre(intIndice)) ListBox2.Items. Add(arrEdad(intIndice)) ListBox3.Items. Add(arrSexo(intIndice)) Ecm. Show("No se pueden registrar alurnos", "Aviso", We5;aaeEcmEuttcn: .OK) E — Private Sub Button1_C1ick(8yVa1 sender As System. C ListBox2.Items. C1ear() For intFi1a = 0 To intIndice If arrEdad(intIndice) >= 18 And arrEdad(intIndice) <= 30 Then If arrSexo(intIndice) = "Femenino" Then ListBox1.Items. Add(arrNombre(intIndice)) ListBox2.Items. Add(arrEdad(intIndice)) ListBox3.Items. Add(arrSexo(intIndice))
  3. 3. no formularios - Microsoft Visual Studio File Edit View Project Build Debug Team Data Format Tools Test Window Help V74‘ fi_ 9 A Form2.vb [Design]" X [ }': ':iJ: *2.- 3 All Win 5 4 Comm E PRODUCTO‘ N : ’ ; § _§ CATEGORIA: "E5 A A [In It ‘ ’ lg n. u. n.
  4. 4. no formularios - Microsoft Visual Studio File Edit View Project Build Debug Team Data Format Tools Test Window Help Eiifilj: H :3-2' is ‘S-ml N A Form2.vb [Design]" X l . .4,. _.. E . .u_. e.__‘. _E 0 T C U D 0 R P : -E114. mg».
  5. 5. no formularios - Microsoft Visual Studio File Edit View Project Build Debug Team Data Format Tools Test Window Help V74‘ fi_ 9 A Form2.vb [Design]" X l }': ':1l: *2.- 3 All Win 5 4 Comm ll PRODUCTO‘ N : ’ ; § _§ CATEGORIA: "E5 A A I; u. l H, u. n. v R « .
  6. 6. no formularios - Microsoft Visual Studio File Edit View Project Build Debug Team Data Tools Test Window Help 9 id , " btnagregar I ~p. ,:m, . . E . _ . x A : %Pub11c Class -crvz Gene” § Dim arrProducto(15) As String Dim arrCodigo(15) As String : Dim arrPrecio(15) As Integer 5 Dim arrCategoria(15) As String 2 Dim intIndice As Integer = -1 g Dim contfruta As Integer = 0 Dim contmenestra As Integer = 0 Dim contverdura As Integer = 0 — Private Sub Form2_Load(ByVal sender As System. Cbject, Byval e As System. EvEn: é"gs) Handles MyBase. Load arrCategoria(0) = ComboBox1.Items. Add("Frutas“) arrCategoria(1) = ComboBox1.Items. Add("Menestras") arrCategoria(2) = ComboBox1.Items. Add("Verduras") arrCategoria(0) = ComboBox2.Items. Add("Frutas") arrCategoria(1) = ComboBox2.Items. Add("Menestras") arrCategoria(2) = ComboBox2.Items. Add("Verduras") End Sub — Private Sub btnagregar_Click(ByVal sender As System. D w, If intIndice < 15 Then intIndice += 1 Byval e As System. EnentJ*gs) Handles btnagregar. Click arrProducto(intIndice) = txtproducto. Text arrCodigo(intIndice) = txtcodigo. Text arrPrecio(intIndice) = txtPrecio. Text arrCategoria(intIndice) = ComboBox1.SelectedItem If ComboBox1.Se1ectedItem = arrCategoria("0") Then contfruta += 1 If ComboBox1.SelectedItem = arrCategoria("1") Then contmenestra += 1 If ComboBox1.SelectedItem = arrCategoria("2“) Then contverdura += 1 End If End If] _. -z-
  7. 7. on fcrmularios - Microsoft Visual Studio File Edit View Project Build Debug Team Data Tools Test Window Help __ 0 JH_ 9 E )’ btnagregar ~p; ,flj: ,]. ‘ 3 arrPrecio(intIndice) = txtPrecio. Text i Gene” E arrCategoria(intIndice) = ComboBox1.SelectedItem g If ComboBox1.Se1ectedItem = arrCategoria("0") Then contfruta += 1 : If ComboBox1.SelectedItem = arrCategoria("1") Then 5 contmenestra += 1 3 If ComboBox1.SelectedItem = arrCategoria("2") Then g contverdura += 1 5 End If ‘ End If End If ListBox1.Items. Add(arrCodigo(intIndice)) ListBox2.Items. Add(arrProducto(intIndice)) ListBox3.Items. Add(arrCategoria(intIndice)) ListBox4.Items. Add(arrPrecio(intIndice)) Else “ ~Ecx. Show("No se pueden registrar el producto", "Aviso", End If End Sub — Private Sub ComboBox2_Selectedlndexchanged(ByVal sender As System. D:ject, Byval e As System. E»entA"gs) Handles Com If ComboBox2.Se1ectedItem = arrCategoria(B) Then For intFi1a = 0 To contfruta ListBox5.Items. Add(arrCodigo(intIndice)) ListBox6.Items. Add(arrProducto(intIndice)) ListBox7.Items. Add(arrCategoria(intIndice)) ListBox8.Items. Add(arrPrecio(intIndice)) End If End If Next

×