Professional Documents
Culture Documents
INTRODUCTION
In this activity we will design and apply the management of basic tools and their
properties which must be done 5 exercises by students where we will handle text boxes,
button images etc. We will begin to implement what is known in the first activity and
put into practice.
OBJECTIVE
Practice what you learned in Unit 1 with the requested exercises, use the toolbox to
interact with the application, use text boxes, labels, buttons, images, mouse handling
which we will learn to use with each exercise performed.
1. Programa que en dos cuadros de texto reciba solo nmeros en uno y en el otro
reciba solo texto en mayscula. Que valide los intentos de ingreso hasta 3 y
bloquee ocultando los cuadros de texto.
Dim contador = 0
e.Handled = True
If Char.IsDigit(e.KeyChar) Then
e.Handled = False
e.Handled = False
e.Handled = False
Else
contador = contador + 1
If contador = 3 Then
MsgBox("limite superado")
TextBox1.Enabled = False
TextBox2.Enabled = False
End If
End If
End If
End If
End Sub
TextBox2.CharacterCasing = CharacterCasing.Upper
e.Handled = True
If Char.IsLetter(e.KeyChar) Then
e.Handled = False
e.Handled = False
e.Handled = False
Else
contador = contador + 1
If contador = 3 Then
MsgBox("limite superado")
TextBox1.Enabled = False
TextBox2.Enabled = False
End If
End If
End If
End If
End Sub
Me.Close()
End Sub
End Class
End Sub
End If
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
'resta
If (Val(deno1.Text) = (deno2.Text)) Then
res1.Text = Val(num1.Text) - Val(num2.Text)
res2.Text = Val(deno1.Text)
Else
res1.Text = (Val(num1.Text) * Val(deno2.Text)) - (Val(deno2.Text) *
Val(deno1.Text))
res2.Text = Val(deno2.Text) * Val(deno1.Text)
End If
End Sub
res1.Text = ""
num1.Text = ""
num2.Text = ""
deno2.Text = ""
deno1.Text = ""
res2.Text = ""
End Sub
Private Sub num1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
num1.KeyPress
If Not IsNumeric(e.KeyChar) Then
e.Handled = True
End If
End Sub
Private Sub num2_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
num2.KeyPress
If Not IsNumeric(e.KeyChar) Then
e.Handled = True
End If
End Sub
CONCLUTION
Unit 1 was reviewed in putting into practice all the learned and implemented the
acquired knowledge which was put into practice with the exercises performed of the
second activity, it was possible to deepen the topics based on the toolbox and its
properties.
BIBLIOGRAPHIC REFERENCES
http://jenelenet.blogspot.com.co/2011/07/limpiar-cajas-de-texto-en-visual-basic.html
http://www.estudiantes.info/matematicas/suma_de_fracciones.htm
https://msdn.microsoft.com/en-us/library/bx185bk6.aspx