how to add a bitmap to a button?

i want to let a radio button display a bitmap and a text on the right of the bitmap. how can i achieve this?

i try to setBitMap,but failed to achieve this. thanks

[175 byte] By [gooon] at [2007-12-24]
# 1

Either you can use CBitmap button class or Create a button

with the BS_BITMAP style and call it’s SetBitmap function.

One thing you should take care is that, the bitmaps should

be valid till the end. It would be better if you keep the bitmap handles as

member variables of the dialog or parent window of the button.

You specify the style either through Create function or in

the resource editor itself

Please see MSDN for more information and sample snippet

Sarath. at 2007-8-31 > top of Msdn Tech,Visual C++,Visual C++ General...
# 2
it seems that i can display bitmap on the button or display text on it. but i can not display both. how can i display both? thanks
gooon at 2007-8-31 > top of Msdn Tech,Visual C++,Visual C++ General...
# 3
Use ownerdrawn button. Just google for it. you will get many
Sarath. at 2007-8-31 > top of Msdn Tech,Visual C++,Visual C++ General...
# 4
any other suggestions? thanks
gooon at 2007-8-31 > top of Msdn Tech,Visual C++,Visual C++ General...
# 5
you can use CBitmapButton to achieve your goal and to Add bitmap you can use

TBADDBITMAP tb;
tb.hInst = ::_Module.GetResourceInstance();
tb.nID = IDB_STANDARD;
SendMessage (hwndTB, TB_ADDBITMAP, 1, (LPARAM)&tb);
::ShowWindow(hwndTB, SW_SHOW);
// hwndTB is the handle of your toolbar
pintu* at 2007-8-31 > top of Msdn Tech,Visual C++,Visual C++ General...