PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → WD23: Image Control empty vs. filled
WD23: Image Control empty vs. filled
Débuté par GuenterP, 24 juin 2018 17:58 - 3 réponses
Posté le 24 juin 2018 - 17:58
Hi, this is maybe a simply-to-answer question:

How to find out whether an image control is empty (= no image shown) or contains an image? Images are coming from the clipboard but could have been emptied by a button with the codeline: MyImage = ""
Posté le 24 juin 2018 - 19:45
Hey Guenter

Maybe you got test one of the image properties if there are filled?
Posté le 25 juin 2018 - 01:00
Hi Guenter

If I remember correctly, testing image..width will give you zero only if empty.

Best regards From Nashville :-)
Posté le 25 juin 2018 - 07:22
Hi Fabrice,
my congratulations!! :cheers:

Imho, the ..width property of an image control refers to the control itself, not to its content. MyImageControl..image..width is impossible anyway. I solved the problem by referring to the caption of MyImageControl. I'm starting with MyImageControl..Caption = "" and whenever it is filled from the Clipboard, I set it to "Image" and whenever the image is deleted, ..caption is set back to "". Not a really clean solution but viable.