Board index » cppbuilder » Cahnge TSpeedButton background color

Cahnge TSpeedButton background color


2004-05-18 10:00:27 PM
cppbuilder96
How to change TSpeedButton background color ?
Thanks.
Sam
 
 

Re:Cahnge TSpeedButton background color

"sam" < XXXX@XXXXX.COM >wrote in message
Quote
How to change TSpeedButton background color ?
Thanks.
Sam
Assuming you have a TSpeedButton called ColorButton:
std::auto_ptr<Graphics::TBitmap>bitmap(new Graphics::TBitmap());
bitmap->Height = 16;
bitmap->Width = 16;
bitmap->TransparentMode = tmFixed;
bitmap->TransparentColor = clBtnFace;
bitmap->Canvas->Pen->Color = static_cast<TColor>(prefs.font.color);
bitmap->Canvas->Brush->Color = static_cast<TColor>(prefs.font.color);
bitmap->Canvas->Brush->Style = bsSolid;
bitmap->Canvas->Rectangle(0, 0, 16, 16);
ColorButton->Glyph->Assign(bitmap.get());
Joe
 

Re:Cahnge TSpeedButton background color

"Joseph F. Muscarella" < XXXX@XXXXX.COM >wrote in message
Quote
Assuming you have a TSpeedButton called ColorButton:
<snip>
That code changes the Glyph, not the button itself.
Gambit
 

{smallsort}