PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → WD23: Image Control empty vs. filled
WD23: Image Control empty vs. filled
Started by GuenterP, Jun., 24 2018 5:58 PM - 3 replies
Posted on June, 24 2018 - 5:58 PM
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 = ""
Posted on June, 24 2018 - 7:45 PM
Hey Guenter

Maybe you got test one of the image properties if there are filled?
Posted on June, 25 2018 - 1:00 AM
Hi Guenter

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

Best regards From Nashville :-)
Posted on June, 25 2018 - 7:22 AM
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.