Does any one know how to change a bitmap image for a button.
This loads an image to the button:
CONTROL mainwindow,@BUTTON,"",230,50,30,25,@CTLBTNBITMAP,BUTTON_4
SETCONTROLTEXT mainwindow,BUTTON_4,GETSTARTPATH+"tabclose.bmp"
But can I change it?
Or do I have to destroy the button and create a new one? or can you use SENDMESSAGE, if so how?
Thanks,
Andy.
Hi Andy,
With CB the bitmap can be changed at any time by using SETCONTROLTEXT. Think it will the same way with IWB.
Your code example looks ok to me. Just change the bitmap name to whatever you need.
SETCONTROLTEXT mainwindow,BUTTON_4,GETSTARTPATH+"YourOwnBitmap.bmp"
Good luck
Egil
P.S.
Had to try with IWB. Attached an example.
Perfect example Egil!
Thanks Larry, but my granddaughter (12) says that the example also could have been set up to the program language change when changing the flag.... maybe a good idea for a future project.
Egil,
Thanks for posting that, it does work for me too.
Andy.