Programacion de Computadoras - Laboratorio 6: Form1 Object Eventargs

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

PROGRAMACION DE COMPUTADORAS – LABORATORIO 6

PROBLEMA N°1

Public Class Form1


Public NRO(19), I As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
NRO(I) = TextBox1.Text
ListBox1.Items.Add(NRO(I))
I = I + 1
TextBox1.Text = ""
TextBox1.Focus()
End Sub

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


System.EventArgs) Handles Button2.Click
Dim WMAYOR, K, W1 As Integer
K = I - 1
For I = 0 To K
If NRO(I) > WMAYOR Then
WMAYOR = NRO(I)
W1 = I
End If
Next
TextBox2.Text = WMAYOR
TextBox3.Text = W1
End Sub

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


System.EventArgs) Handles Button3.Click
TextBox1.Text = ""
TextBox2.Text = ""
ListBox1.Items.Clear()
End Sub

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


System.EventArgs) Handles Button4.Click
End
End Sub
End Class

PROBLEMA N°3
Public Class Form1
Public VECT(99), I As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
VECT(I) = TextBox1.Text
ListBox1.Items.Add(VECT(I))
I = I + 1
TextBox1.Clear()
TextBox1.Focus()
End Sub

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


System.EventArgs) Handles Button2.Click
Dim NUM, K, X As Integer
NUM = TextBox2.Text
K = I - 1
For I = 0 To K
If VECT(I) = NUM Then
X = X + 1
End If
Next
TextBox3.Text = X

End Sub

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


System.EventArgs) Handles Button3.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
ListBox1.Items.Clear()

End Sub

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


System.EventArgs) Handles Button4.Click
End
End Sub
End Class
PROBLEMA N°5

Public Class Form1


Public A(14), B(14), I As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
A(I) = TextBox1.Text
B(I) = TextBox2.Text
ListBox1.Items.Add(A(I))
ListBox2.Items.Add(B(I))
I = I + 1
End Sub

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


System.EventArgs) Handles Button2.Click
Dim C(14), K, WMAYOR As Integer
K = I - 1
For I = 0 To K
C(I) = A(I) + B(I)
ListBox3.Items.Add(C(I))
If C(I) > WMAYOR Then
WMAYOR = C(I)
End If
Next
TextBox3.Text = WMAYOR
End Sub

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


System.EventArgs) Handles Button3.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
ListBox1.Items.Clear()
ListBox2.Items.Clear()
ListBox3.Items.Clear()
End Sub

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


System.EventArgs) Handles Button4.Click
End
End Sub
End Class

PROBLEMA N°7
Public Class Form1
Public NRO(19), I As Integer

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


System.EventArgs) Handles Button1.Click
NRO(I) = TextBox1.Text
ListBox1.Items.Add(NRO(I))
I = I + 1
End Sub

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


System.EventArgs) Handles Button2.Click
Dim K, NUM, C As Integer
K = I - 1
NUM = TextBox2.Text
For I = 0 To K
If NRO(I) = NUM Then
C = C + 1
End If
Next
If C = 0 Then
TextBox3.Text = "NO SE ENCUENTRA EN EL VECTOR"
Else
TextBox3.Text = "SI SE ENCUENTRA EN EL VECTOR"
End If
End Sub

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


System.EventArgs) Handles Button3.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
ListBox1.Items.Clear()

End Sub

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


System.EventArgs) Handles Button4.Click
End
End Sub
End Class

You might also like