cynbbq
Messages postés6Date d'inscriptionvendredi 31 octobre 2003StatutMembreDernière intervention23 novembre 2003
-
11 nov. 2003 à 23:41
Renfield
Messages postés17287Date d'inscriptionmercredi 2 janvier 2002StatutModérateurDernière intervention27 septembre 2021
-
12 nov. 2003 à 00:09
j'aimerais savoir ce qu'il y a d'anormal dans mon code pour enlever tous les pictures box qui n'ont pas les noms que j'ai inscrit.
'Dim mycontrol As Control
For Each mycontrol In Me.Controls.Count
If TypeOf mycontrol Is VB.PictureBox Then
If mycontrol.Name <> "pctHautCentre" And _
mycontrol.Name <> "pctHautDroit" And _
mycontrol.Name <> "pctBasGauche" And _
mycontrol.Name <> "pctBasCentre" And _
mycontrol.Name <> "pctBasDroit" Then
Set mycontrol = Nothing
End If
End If
Next mycontrol
Renfield
Messages postés17287Date d'inscriptionmercredi 2 janvier 2002StatutModérateurDernière intervention27 septembre 202174 12 nov. 2003 à 00:09
Le code de ton énumeration n'est pas tout a fait correct :
Dim mycontrol As Control
For Each mycontrol In Me.Controls
If TypeOf mycontrol Is VB.PictureBox Then
If mycontrol.Name <> "pctHautCentre" And _
mycontrol.Name <> "pctHautDroit" And _
mycontrol.Name <> "pctBasGauche" And _
mycontrol.Name <> "pctBasCentre" And _
mycontrol.Name <> "pctBasDroit" Then
Set mycontrol = Nothing
End If
End If
Next mycontrol