Click to See Complete Forum and Search --> : Icon on a Button


STerry
April 14th, 1999, 02:41 PM
Is there an easy way to show an icon on top of a button?

I have a set of 16x16 icons. I'd like to chose one and display it on top of a button.

I tried using OwnerDraw. Is that the best approach? If so, how do I draw the standard buttons Up/Down/Focus/Disabled?

Gomez Addams
April 14th, 1999, 03:39 PM
There are two fairly easy options - CToolBar and CToolBarCtrl can handle
this stuff with their default methods and I think it sizes the button to the image.
There are classes on this site that demonstrate using them with high-color images
also. Another option is to use CBitmapButton. I think it sizes the button to the
image size also. It takes one image for each of the four states. See the VC
sample called CtrlTest for an illustration of this.