Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

?? HBITMAP ??

Status
Not open for further replies.

wolfmah

Programmer
Oct 24, 2001
17
CA
Here my problem, I got a picture control in one of my dialog box and I want to change a bitmap picture in it when the user select one of the option found in a combo box near by.

I have set a variable link to the picture control (CStatic) and I know that there is a member function to set a picture (SetBitmap()) but I dont know how to use the parameter HBITMAP that it need.

BTW, I don't need to create the picture from scratch, they are already existing and they are all load in the Bitmap Resource.
 
CBitmap myBitmap;
myBitmap.LoadBitmap(resource id);
mystatic.SetBitmap((HBITMAP)myBitmap);

assuming mystatic is your CStatic.
 
Thanks, this work great but I can't seem to make the picture appear on the Dialog Box "startup". The picture only appear once you have click one time on the combo box. I have try the UpdataData(FALSE); but it didn't help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top