Visual Basic - Comprobar TextBox vacios
Written by lopezatienza on 29 Octubre 2008 – 14:26 -Creamos nuestro Proyecto.
Agregamos 4 TextBox llamados: "tbnombre" , "tbdireccion" , "tbedad" , "tbtelefono"
Agregamos un Button llamado "btnaceptar"
Introducimos el siguiente código en "Form1.vb"
Public Class Form1
Private Sub btnaceptar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnaceptar.Click
If tbnombre.Text = "" Or tbdireccion.Text = "" Or tbedad.Text = "" Or tbtelefono.Text = "" Then
MsgBox("Rellene todos los campos por favor")
Else : MsgBox("Aceptado")
tbnombre.Clear()
tbdireccion.Clear()
tbedad.Clear()
tbtelefono.Clear()
End If
End Sub
End Class
Tags: Visual Basic
Posted in Visual Basic .NET |

Marzo 23rd, 2010 at 7:08
gracias esta perfecta la solucion par .net
Marzo 27th, 2010 at 13:27
Me alegro de que te sirviera de ayuda.
Un saludo!