Load Picture1(1)
With Picture1(1)
Set .Container = Picture1(0)
.Move 0, 0, Picture1(0).Width / 2, Picture1(0).Height / 2
.Visible = True
.BackColor = RGB(255, 0, 0)
End With
Set .Container = Picture1(0)ou alors je n'ai pas d'erreur mais rien ne s'affiche mais l'erreur apparait lorsque je veux modifier la couleur de la picturebox (après l'avoir créé)!
Load Picture1(1) With Picture1(1)
Load Picture1(1) 'charge la nouvelle image With Picture1(1) Set .Container = Picture1(0) 'inclus la nouvelle image dans l'image existante .Move 0, 0, Picture1(0).Width / 2, Picture1(0).Height / 2 'placement de l'image à l'endroit voulu .Visible = True .BackColor = RGB(255, 0, 0) End With
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim toto As Integer
toto = Picture1.Count
Load Picture1(toto)
With Picture1(toto)
Set .Container = Picture1(0)
.Move 0, 0, Picture1(0).Width / 2, Picture1(0).Height / 2
.Visible = True
.BackColor = RGB(255, 0, 0)
End With
toto = Picture1.Count
Load Picture1(toto)
With Picture1(toto)
Set .Container = Picture1(0)
.Move Picture1(toto - 1).Left + Picture1(toto - 1).Width, 0, Picture1(0).Width / 2, Picture1(0).Height / 2
.Visible = True
.BackColor = RGB(0, 255, 0)
End With
Private Sub Command1_Click()
ajouter_picture Picture1(0), RGB(255, 0, 0)
ajouter_picture Picture1(0), RGB(0, 255, 0)
ajouter_picture Picture1(0), RGB(0, 0, 255)
End Sub
Private Sub ajouter_picture(dans_quoi As PictureBox, couleur As Long)
Dim toto As Integer
toto = Picture1.Count
Load Picture1(toto)
With Picture1(toto)
Set .Container = Picture1(0)
agauche = IIf(toto = 1, 0, Picture1(toto - 1).Left + Picture1(toto - 1).Width)
.Move agauche, 0, Picture1(0).Width / 4, Picture1(0).Height / 4
.Visible = True
.BackColor = couleur
End With
End Sub