ingresar datos prueba
TRANSCRIPT
![Page 1: Ingresar datos Prueba](https://reader035.vdocuments.co/reader035/viewer/2022071709/55a4cc621a28abbe158b4749/html5/thumbnails/1.jpg)
Ingresar Datos
![Page 2: Ingresar datos Prueba](https://reader035.vdocuments.co/reader035/viewer/2022071709/55a4cc621a28abbe158b4749/html5/thumbnails/2.jpg)
Diseño
• Se debe ingresar tres cajas de textos par ingresar nombre, y dos notas además de un lisboxt para visualizar cada dato agregado dos botones uno para agregar los datos ingresados a un lisboxt y otro ara salir del programa
![Page 3: Ingresar datos Prueba](https://reader035.vdocuments.co/reader035/viewer/2022071709/55a4cc621a28abbe158b4749/html5/thumbnails/3.jpg)
![Page 4: Ingresar datos Prueba](https://reader035.vdocuments.co/reader035/viewer/2022071709/55a4cc621a28abbe158b4749/html5/thumbnails/4.jpg)
Clase cprueba
• Contiene los siguientes campos
Public Nombre As String
Public N1 As Integer
Public N2 As Integer
Public Sig As Cprueba
Public Pridato As Cprueba
• Contiene el siguiente métodos con las subvariables
Public Sub Agregar(ByVal VnombreAs String, ByVal Vn1 As Integer, ByVal Vn2 As Integer)
![Page 5: Ingresar datos Prueba](https://reader035.vdocuments.co/reader035/viewer/2022071709/55a4cc621a28abbe158b4749/html5/thumbnails/5.jpg)
En el método agregar sedebe declarar unavariable de tipo cpruebapara tomar el nombre quese ingresan en la cajade texto luego preguntarsi el primer dato esnulo entonces tome elprimer valor ingresadocaso contrario pasara aun siguiente contenido
• Dim nuevo As Cprueba
• nuevo = New Cprueba
• nuevo.Nombre = Vnombre
• nuevo.N1 = Vn1
• nuevo.N2 = Vn2
• If IsNothing(Pridato) Then
• Pridato = nuevo
• Else
• Dim aux As Cprueba
• aux = Pridato
• While Not IsNothing(aux.Sig)
• aux = aux.Sig
• End While
• aux.Sig = nuevo
• End If
![Page 6: Ingresar datos Prueba](https://reader035.vdocuments.co/reader035/viewer/2022071709/55a4cc621a28abbe158b4749/html5/thumbnails/6.jpg)
Formulario
• El botón agregar contiene la siguiente programación:
Dim op As Cprueba = New Cprueba
op.Agregar(TextBox1.Text,TextBox2.Text,TextBox3.Text)
Me.ListBox1.Items.Add(TextBox1.Text & "," & TextBox2.Text & "," & TextBox3.Text)
• El botón
• If MsgBox("Esta seguro que desea salir del programa", MsgBoxStyle.YesNoCancel) = MsgBoxResult.Yes Then End