Problème vb.net
Résolu
MrValthor
Messages postés
14
Date d'inscription
Statut
Membre
Dernière intervention
-
MrYAU31 Messages postés 3808 Date d'inscription Statut Membre Dernière intervention -
MrYAU31 Messages postés 3808 Date d'inscription Statut Membre Dernière intervention -
Bonjour/Bonsoir ,
Voilà je m'exerce pour devenir un dev vb.net sauf que j'ai quelque petite inperfection.
Je fais un générateur mais un faux pour m'entrainer.
Dans ce générateur il y a une progressbar.
Le code de mon timer est le suivant :
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ProgressBar1.Increment(1)
Label2.Text = ProgressBar1.Value & (" %")
If ProgressBar1.Value = 1 Then
Label10.Text = "connexion en cours..."
End If
If ProgressBar1.Value = 53 Then
Label10.Text = "connexion réussi"
End If
If ProgressBar1.Value = 56 Then
Label10.Text = "installation en cour"
End If
If ProgressBar1.Value = 100 Then
Label10.Text = "installation terminé"
MsgBox("L'installation est un succès veuillez vérifier IG")
End If
End Sub
Je souhaite qu'1 msgbox sauf que ça m'en affiche un bonne centaine , comment faire
Meric d'avance
Bye ;)
Voilà je m'exerce pour devenir un dev vb.net sauf que j'ai quelque petite inperfection.
Je fais un générateur mais un faux pour m'entrainer.
Dans ce générateur il y a une progressbar.
Le code de mon timer est le suivant :
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ProgressBar1.Increment(1)
Label2.Text = ProgressBar1.Value & (" %")
If ProgressBar1.Value = 1 Then
Label10.Text = "connexion en cours..."
End If
If ProgressBar1.Value = 53 Then
Label10.Text = "connexion réussi"
End If
If ProgressBar1.Value = 56 Then
Label10.Text = "installation en cour"
End If
If ProgressBar1.Value = 100 Then
Label10.Text = "installation terminé"
MsgBox("L'installation est un succès veuillez vérifier IG")
End If
End Sub
Je souhaite qu'1 msgbox sauf que ça m'en affiche un bonne centaine , comment faire
Meric d'avance
Bye ;)
A voir également:
- Problème vb.net
- Vb.net express - Télécharger - Langages
- Vb.net - Télécharger - Langages
- Convert | VB.net ✓ - Forum Framework .NET
- Vb.net editor - Télécharger - Langages
- Listview vb.net ✓ - Forum Framework .NET
1 réponse
Bonjour,
Le problème est que ton MsgBox est dans ton Timer1.Tick. Il se produira donc à chaque fois.
Place le dans l'évènement déclenché par la fin de ton Timer.
https://docs.microsoft.com/fr-fr/dotnet/api/system.timers.timer.elapsed?redirectedfrom=MSDN&view=netframework-4.8
Le problème est que ton MsgBox est dans ton Timer1.Tick. Il se produira donc à chaque fois.
Place le dans l'évènement déclenché par la fin de ton Timer.
https://docs.microsoft.com/fr-fr/dotnet/api/system.timers.timer.elapsed?redirectedfrom=MSDN&view=netframework-4.8