VoltageImage SetCurrentImage behaviour
Posted: Wed May 25, 2022 11:24 pm
Hi Folks...
I have a control that I'd like to have change a displayed image (for another). Looking at the methods currently available in VoltageImage, I spotted SetCurrentImage, and thought that would make a neater solution than creating a stack of hidden images and toggling their visibility.
I've added the images as extra resources, but unfortunately, SetCurrentImage doesn't seem to trigger a re-draw of the image object, so the displayed image isn't updated until something else (tool tip overlap, mouse click etc.) triggers the refresh.
Toggling the image visibility (from visible to invisible and back to visible) does update the display, but seems awkward.
Is there a better way of forcing an image redraw in this sort of situation and/or am I expecting the wrong things from SetCurrentImage?
Cheers,
--
Terry McG
I have a control that I'd like to have change a displayed image (for another). Looking at the methods currently available in VoltageImage, I spotted SetCurrentImage, and thought that would make a neater solution than creating a stack of hidden images and toggling their visibility.
I've added the images as extra resources, but unfortunately, SetCurrentImage doesn't seem to trigger a re-draw of the image object, so the displayed image isn't updated until something else (tool tip overlap, mouse click etc.) triggers the refresh.
Toggling the image visibility (from visible to invisible and back to visible) does update the display, but seems awkward.
Is there a better way of forcing an image redraw in this sort of situation and/or am I expecting the wrong things from SetCurrentImage?
Cheers,
--
Terry McG