Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ImageList Control - KeyExists() procedure
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
ImageList Control - KeyExists() procedure
Divers
Thread ID:
00662237
Message ID:
00662237
Vues:
60
Anyone know quick way to determine if a key exists in an ImageList control?

Tried to do the following but getting the error message "OLE IDispatch exception code 0 from ListImages: Element not found.."
loImage = toImageList.ListImages(lcIconKey)

IF NOT VARTYPE(loImage)='O'
  Add new image...
ENDIF
My other choice is as follows but the code is called many times and itterating through the collection very call seems a bit much
llImageExists = .F.
FOR EACH loImage IN toImageList.ListImages
  IF loImage.KEY = lcIconKey
    llImageExists = .T.
  ENDIF
ENDFOR

IF NOT llImageExists
  Add new image...
ENDIF
Heavy Metal Pedal - click with care
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform