Test Foro de elhacker.net SMF 2.1

Programación => .NET (C#, VB.NET, ASP) => Programación General => Programación Visual Basic => Mensaje iniciado por: Bourne Ultimatum en 20 Marzo 2006, 19:59 PM

Título: como seria
Publicado por: Bourne Ultimatum en 20 Marzo 2006, 19:59 PM
como seria la sentecia para que me diga que tiene algo adentro
ejemplo
tengo un text1.text y quiero saber si tiene algo adentro o esta vacio
if text1.text = como seria?
Título: Re: como seria
Publicado por: NYlOn en 20 Marzo 2006, 20:06 PM

If Text1.Text = "Hola" then
     MsgBox "El texto dice HOLA"
end if


'Si queres ver si esta vacio:
If Text1.Text = "" then
     MsgBox "El textbox esta vacio"
end if


Saludos.-
Título: Re: como seria
Publicado por: Bourne Ultimatum en 20 Marzo 2006, 20:09 PM
gracias era eso las " " lo sabia pero no me acordaba muchas gracias
Título: Re: como seria
Publicado por: .:CorTeX:. en 20 Marzo 2006, 20:14 PM
Tambien puede ser
If Len(text1.text) = 0 then
       Msgbox "Esta vacio man!"
End If
Título: Re: como seria
Publicado por: Pitoniso en 23 Marzo 2006, 22:22 PM
Cita de: NYlOn en 20 Marzo 2006, 20:06 PM

If Text1.Text = "Hola" then
     MsgBox "El texto dice HOLA"
end if


'Si queres ver si esta vacio:
If Text1.Text = "" then
     MsgBox "El textbox esta vacio"
end if


Saludos.-

Pequeña Retificación
Private Sub Command1_Click()
     MsgBox "El texto dice " & Text1
End Sub
Título: Re: como seria
Publicado por: Grimble Grumble en 24 Marzo 2006, 09:37 AM
No recuerdo bien si era con el Text o con el Label  q se podia poner

If txt.caption=Empty then
   msgbox "Vacio"
end if

Corrijanme si me equivoco...

Saludos