如何动态改变speedbutton的图片??
定义了imagelist控件,并加了几副图片,想实现点击一次speedbutton按纽时,改变它的图片,我这样写错在哪里?为何实现不了我想要的功能!
int imageindex;
__fastcall TMainForm::TMainForm(TComponent* Owner)
: TForm(Owner)
{
ImageList1->GetBitmap(0,SpeedButton1->Glyph);
imageindex=0;
}
void __fastcall TMainForm::SpeedButton1Click(TObject *Sender)
{
if(imageindex==0)
{
ImageList1->GetBitmap(1,SpeedButton1->Glyph);
imageindex=1;
}
else
{
ImageList1->GetBitmap(0,SpeedButton1->Glyph);
imageindex=0;
}
}