Msgbox et LoginForm

Résolu
teamtiti Messages postés 61 Date d'inscription jeudi 19 juillet 2007 Statut Membre Dernière intervention 28 mai 2008 - 13 sept. 2007 à 11:07
teamtiti Messages postés 61 Date d'inscription jeudi 19 juillet 2007 Statut Membre Dernière intervention 28 mai 2008 - 13 sept. 2007 à 11:21
Salut voila j'ai un loginform avec ce code:







Private



Sub
OK_Click(

ByVal
sender

As
System.Object,

ByVal
e

As
System.EventArgs)

Handles
OK.Click


If
(UsernameTextBox.Text =

"expl"
)

And
(PasswordTextBox.Text =

"expl"
)

Then

MDIParent1.Show()


Visible =




False






End



If

J'aimerais renvoyer une msgbox si l'username ou le password n'est pas bon. Merci de votre aide

5 réponses

lolokun Messages postés 1241 Date d'inscription mardi 10 octobre 2006 Statut Membre Dernière intervention 27 août 2013 7
13 sept. 2007 à 11:12
Salut,

If(UsernameTextBox.Text =
"expl")
And(PasswordTextBox.Text =
"expl")
ThenMDIParent1.Show()

Visible =

False

Else

MessageBox.show("Username ou password incorrect","Info",MessageBoxButtons.OKCancel,MessageBoxIcon.Error)

End If

 
3
Utilisateur anonyme
13 sept. 2007 à 11:11
Salut,

Rajoute un Else a ta condition
If Condition Then
   SiVrai
Else
   SiFaux
End IF







__________
Kenji

(


Nouveau forum VBA/Office
0
jrivet Messages postés 7392 Date d'inscription mercredi 23 avril 2003 Statut Membre Dernière intervention 6 avril 2012 60
13 sept. 2007 à 11:12
Salut,
Suffit coder le Else de ta condition et d'y afficher un MessageBox

@+: Ju£i?n
Pensez: Réponse acceptée
0
pape0 Messages postés 132 Date d'inscription mercredi 18 février 2004 Statut Membre Dernière intervention 1 septembre 2014
13 sept. 2007 à 11:14
Comme cela

Private
Sub OK_Click(
ByVal sender
As System.Object,
ByVal e
As System.EventArgs)
Handles OK.Click

If (UsernameTextBox.Text =
"expl")
And (PasswordTextBox.Text =
"expl")
ThenMDIParent1.Show()

Visible =

False

ElseMsgBox(

"Le login ou le password, n'est pas valide!")

End
If

End
Sub

<hr />
Aller voir ces sites
http://www.pape-bleu.net
 
 ou http://www.papebleu.net.
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
teamtiti Messages postés 61 Date d'inscription jeudi 19 juillet 2007 Statut Membre Dernière intervention 28 mai 2008
13 sept. 2007 à 11:21
Je vous remerci bien de vos réponse rapide et donc voila mon code



Private



Sub
OK_Click(

ByVal
sender

As
System.Object,

ByVal
e

As
System.EventArgs)

Handles
OK.Click




If
(UsernameTextBox.Text =

"expl"
)

And
(PasswordTextBox.Text =

"expl"
)

Then



MDIParent1.Show()


Visible =




False






Else

MessageBox.Show(




"Username ou password incorrect"
,

"Info"
, MessageBoxButtons.OKCancel, MessageBoxIcon.Error)


End



If






End



Sub
0
Rejoignez-nous