在C++Builder里,怎样修改TButton或TBitBtn得颜色
展开全部
TRect Rect;
Graphics::TBitmap* Bmp;
TControlCanvas* Canvas;
Bmp = new Graphics::TBitmap;
Canvas = new TControlCanvas;
Canvas->Control = Button1;
Rect = Button1->ClientRect;
Bmp->Width = Rect.Width();
Bmp->Height = Rect.Height();
Bmp->Canvas->CopyRect(Rect,Canvas, Rect);
Bmp->Transparent = true;
Bmp->TransparentColor = clBtnFace;
Canvas->Brush->Color = clBlue;
Canvas->FillRect(Rect);
Canvas->Draw(0, 0, Bmp);
delete Bmp;
delete Canvas;
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询