"AliR (VC++ MVP)" <AliR@online.nospam> wrote in message
news:puAJh.4673$JZ3.4250@newssvr13.news.prodigy.net...
Things don't work that way.
You will have to use owner draw buttons.
See if you can find one here that suits you
http://www.codeproject.com/buttonctrl/#Owner%2Ddraw+buttons
AliR.
"nappy" <spam@spam.com> wrote in message
news:JozJh.6697$yW.5847@newssvr11.news.prodigy.net...
I am working with arrays of CBitmapButtons but the bitmaps themselves
are dynamic. I need to be able to create them at runtime. Once I have a
bitmap and I have drawn what I want on it how do I make it look like a
resource so I can use the CBitmapButton::LoadBitmaps() function to set
it up?
I don't think I have to subclass the control if I can do this.
thanks
nap.
I managed to do it by subclassing the CBitmapButton and adding this:
int CBmpBtn::SetBmp(CBitmap &bitmap,int state)
{
HANDLE hbitmap;
hbitmap = bitmap.operator HBITMAP();
switch(state)
{
case 0:
m_bitmap.Attach(hbitmap);
break;
case 1:
m_bitmapSel.Attach(hbitmap);
break;
case 2:
m_bitmapFocus.Attach(hbitmap);
break;
case 3:
m_bitmapDisabled.Attach(hbitmap);
break;
return 1;
}
Seems to work.. Is this wrong?