cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Not applicable

Changing bitmap on the fly

I know it's been asked before but haven't seen a response yet. When in doubt, just ask it again. 🙂

First off, this is an InstallScript project.

If I add a bitmap control to a dialog, I can point to the image I want to use during design time and everything is hunky-dory.

However, I want to be able to change this image based on a choice that the user selects on a previous screen (customer chooses 'A', load this image, else load other image) during run-time.

Is there a way to do this on the fly? I know you can do stuff with CtrlSetText, but obviously that's for text boxes.
Labels (1)
0 Kudos
(2) Replies
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

It is possible to specify an alternate image for dialogs by using the DialogSetInfo function and passing DLG_INFO_ALTIMAGE for the nInfoType parameter. Note this only affects dialogs with a bitmap control using control ID 1200 (which is used by the banner image on interior panel dialogs and the InstallShield setup icon on exterior panel dialogs). It is not possible to dynamically change bitmaps for any other controls.
0 Kudos
RobertDickau
Flexera Alumni

Apart from the banner bitmap that Josh describes, if you have a small, fixed set of images, you can add them in overlapping bitmap controls, and then use the ShowWindow API function to show the correct one and hide the others...
0 Kudos