Détecter si un textbox est rempli

Résolu
jerlo11 Messages postés 109 Date d'inscription mardi 19 mai 2015 Statut Membre Dernière intervention 17 novembre 2022 - 7 nov. 2016 à 19:27
jerlo11 Messages postés 109 Date d'inscription mardi 19 mai 2015 Statut Membre Dernière intervention 17 novembre 2022 - 8 nov. 2016 à 15:31
Bonsoir à tous,

Comment détecter si un textbox est rempli ?

Je sais dire l'inverse avec :
if textbox1.text = "" then
blabla
End if


Mais l'inverse est-il possible ?
Vous remerciant par avance pour vos tuyaux

2 réponses

NHenry Messages postés 15112 Date d'inscription vendredi 14 mars 2003 Statut Modérateur Dernière intervention 13 avril 2024 159
7 nov. 2016 à 20:03
if textbox1.text <> "" then
0
jerlo11 Messages postés 109 Date d'inscription mardi 19 mai 2015 Statut Membre Dernière intervention 17 novembre 2022
8 nov. 2016 à 15:31
Pb résolu merci pour vos précisions ;)
0
cgandco Messages postés 219 Date d'inscription mercredi 26 octobre 2011 Statut Membre Dernière intervention 22 juin 2017 9
8 nov. 2016 à 11:06
Bonjour,

Et pour éviter les textbox avec uniquement des espaces.

if textbox1.text.Trim() <> "" then 


Bonne journée
0
Whismeril Messages postés 19021 Date d'inscription mardi 11 mars 2003 Statut Contributeur Dernière intervention 16 avril 2024 656
Modifié par Whismeril le 8/11/2016 à 11:11
Bonjour
A ce compte là autant utiliser String.IsNullOrWhiteSpace
https://msdn.microsoft.com/fr-fr/library/system.string.isnullorwhitespace(v=vs.110).aspx
0
cgandco Messages postés 219 Date d'inscription mercredi 26 octobre 2011 Statut Membre Dernière intervention 22 juin 2017 9 > Whismeril Messages postés 19021 Date d'inscription mardi 11 mars 2003 Statut Contributeur Dernière intervention 16 avril 2024
8 nov. 2016 à 12:01
Oui c'est vrai
0
Rejoignez-nous