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
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
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
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