A voir également:
- Image dans Frame en Visual Basic
- Visual basic - Télécharger - Langages
- Microsoft 365 basic - Accueil - Microsoft Office
- Visual c++ 2019 - Guide
- Visual paradigm - Télécharger - Gestion de données
- Image iso - Guide
7 réponses
Bonjour,
Pas la peine de créer un nouveau Post à chaque question sur le meme sujet.
On avait vu tout à l'heure comment affecter des valeurs aux controles Image (Image.Picture)
Dans le code du boutton Affichage
Dans le code du bouton Nouveau
A+.
Pas la peine de créer un nouveau Post à chaque question sur le meme sujet.
On avait vu tout à l'heure comment affecter des valeurs aux controles Image (Image.Picture)
Dans le code du boutton Affichage
If val(Text1.Text)=val(Text2.Text) then Image3.Picture=Image1.Picture Image4.Picture=Image2.Picture End if If val(Text1.Text)>val(Text2.Text) then Image3.Picture=Image1.Picture Image4.Picture="" End if If val(Text1.Text)<val(Text2.Text) then Image3.Picture="" Image4.Picture=Image2.Picture End if
Dans le code du bouton Nouveau
Image3.Picture="" Image4.Picture="" Text1.Text="" Text2.Text=""
A+.
Bonjour,
Quand j'ai fait comme vous avez dit, ça ne marche pas. On m'affiche un message d'erreur comme quoi le type n'est pas compatible. Et là on fait référence aux ""
Merci.
Quand j'ai fait comme vous avez dit, ça ne marche pas. On m'affiche un message d'erreur comme quoi le type n'est pas compatible. Et là on fait référence aux ""
Merci.
Re,
J'ai fait un test chez moi. Effectivement ça ne marche pas avec Image1.Picture = ""
Il faut mettre Image1.Picture = Nothing
Voila ce que j'ai fait:
J'ai fait un test chez moi. Effectivement ça ne marche pas avec Image1.Picture = ""
Il faut mettre Image1.Picture = Nothing
Voila ce que j'ai fait:
'Boutton afficher Private Sub Command1_Click() Frame1.Visible = False If Val(Text1.Text) = Val(Text2.Text) Then Image3.Picture = Image1.Picture Image4.Picture = Image2.Picture End If If Val(Text1.Text) > Val(Text2.Text) Then Image3.Picture = Image1.Picture Image4.Picture = Nothing End If If Val(Text1.Text) < Val(Text2.Text) Then Image3.Picture = Nothing Image4.Picture = Image2.Picture End If Frame2.Visible = True End Sub 'Boutton nouveau Private Sub Command2_Click() Image3.Picture = Nothing Image4.Picture = Nothing Text1.Text = "" Text2.Text = "" Frame1.Visible = True Frame2.Visible = False End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
Bonsoir,
Je vous montre comment j'ai fait concernant le code :
- L'interface code du formulaire :
- L'interface code du bouton Nouveau :
- L'interface code du bouton afficher :
Merci.
Je vous montre comment j'ai fait concernant le code :
- L'interface code du formulaire :
Private Sub Form_Load() Frame1.Visible = True Frame2.Visible = False End Sub
- L'interface code du bouton Nouveau :
Private Sub Cmd_Nouveau_Click() Frame1.Visible = True Frame2.Visible = False Image3.Picture = "" Image4.Picture = "" Text1.Text = "" Text2.Text = "" End Sub
- L'interface code du bouton afficher :
Private Sub Cmd_Afficher_Click() Frame1.Enabled = False Frame2.Enabled = True If Val(Text1.Text) = Val(Text2.Text) Then Image3.Picture = Image1.Picture Image4.Picture = Image2.Picture End If If Val(Text1.Text) > Val(Text2.Text) Then Image3.Picture = Image1.Picture Image4.Picture = "" End If If Val(Text1.Text) < Val(Text2.Text) Then Image3.Picture = "" Image4.Picture = Image2.Picture End If End Sub
Merci.
Bonsoir,
J'ai fait avec Nothing et ça marche bien.
Maintenant j'ai compris que je n'ai pas besoin de à chaque fois de nouveau post mais je sais que j'aurai d'autres questions.
Merci et merci encore.
J'ai fait avec Nothing et ça marche bien.
Maintenant j'ai compris que je n'ai pas besoin de à chaque fois de nouveau post mais je sais que j'aurai d'autres questions.
Merci et merci encore.
et voila la correction
Private Sub Cmd_Nouveau_Click() Frame1.Visible = True Frame2.Visible = False Image3.Picture = Nothing Image4.Picture = Nothing Text1.Text = "" Text2.Text = "" End Sub Private Sub Cmd_Afficher_Click() Frame1.Visible = False Frame2.Visible = True If Val(Text1.Text) = Val(Text2.Text) Then Image3.Picture = Image1.Picture Image4.Picture = Image2.Picture End If If Val(Text1.Text) > Val(Text2.Text) Then Image3.Picture = Image1.Picture Image4.Picture = Nothing End If If Val(Text1.Text) < Val(Text2.Text) Then Image3.Picture = Nothing Image4.Picture = Image2.Picture End If End Sub