Board index » cppbuilder » TMySpeedButton with a build-in Glyph

TMySpeedButton with a build-in Glyph


2004-06-12 08:52:00 PM
cppbuilder51
How to create TMySpeedButton derived from TSpeedButton component with a
build-in Glyph ? (ie. when drop the TMySpeedButton on the form, it will
appear with its build in glyph)
 
 

Re:TMySpeedButton with a build-in Glyph

<Tomas>wrote in message news:40cafc7f$ XXXX@XXXXX.COM ...
Quote
How to create TMySpeedButton derived from
TSpeedButton component with a build-in Glyph ? (ie.
when drop the TMySpeedButton on the form, it will
. appear with its build in glyph)
Simply add a bitmap to your package's resources and then load the Glyph in
the button's constructor.
Gambit
 

Re:TMySpeedButton with a build-in Glyph

Is that by the following function? If it is, how to define Instance for the
package? Can you give me an example please ?
void __fastcall LoadFromResourceName(unsigned Instance, const AnsiString
ResName);
Quote
Simply add a bitmap to your package's resources and then load the Glyph in
the button's constructor.
Gambit


 

{smallsort}

Re:TMySpeedButton with a build-in Glyph

<Tomas>wrote in message news: XXXX@XXXXX.COM ...
Quote
Is that by the following function?
Yes, or alternatively LoadFromResourceID().
Quote
If it is, how to define Instance for the package?
Use the FindClassHInstance() function.
Quote
Can you give me an example please ?
__fastcall TMySpeedButton::TMySpeedButton(TComponent *Owner)
: TMySpeedButton(Owner)
{
Glyph->LoadFromResourceID(FindClassHInstance(__classid(TMySpeedButton)),
MYGLYPHID);
}
Gambit