Professional Documents
Culture Documents
de la persona")
End If
End If
End Sub
Private Sub rb_apellido_CheckedChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles rb_apellido.CheckedChanged
Dim letras As Integer
If rb_apellido.Checked = True Then
If txt_apellido.Text <> Nothing Then
apellido = txt_apellido.Text
letras = CInt(InputBox("Cuantas letras va a extraer del apellido"))
txt_resul.Text = Microsoft.VisualBasic.Right(apellido, letras)
Else
MsgBox("Debe escribir apellido
End If
de la persona")
End If
End Sub
Private Sub rb_mayuscula_CheckedChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles rb_mayuscula.CheckedChanged
If rb_mayuscula.Checked = True Then
If txt_apellido.Text <> Nothing And txt_nombre.Text <> Nothing Then
nombre = txt_nombre.Text
apellido = txt_apellido.Text
'concatenar y pasar a mayuscula
txt_resul.Text = UCase(nombre + " " + apellido)
Else
MsgBox("Debe escribir nombre y apellido de la persona")
End If
End If
End Sub
Private Sub rb_subcadena_CheckedChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles rb_subcadena.CheckedChanged
Dim letras, posicion As Integer
If rb_subcadena.Checked = True Then
If txt_apellido.Text <> Nothing Then
apellido = txt_apellido.Text
letras = CInt(InputBox("Cuantas letras va a extraer del apellido"))
posicion = CInt(InputBox("A partir de que posicion"))
txt_resul.Text = Microsoft.VisualBasic.Mid(apellido, posicion, letras)
Else
MsgBox("Debe escribir apellido
End If
de la persona")
End If
End Sub
Private Sub txt_apellido_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txt_apellido.KeyPress
If IsNumeric(e.KeyChar) Then
MessageBox.Show("No se deben ingresar numeros")
e.Handled = True
End If
End Sub
de la persona")