我得speedbutton1是放在panel上的,
BnOKDefProc = SpeedButton1->WindowProc;
SpeedButton1->WindowProc = BnOkWndProc;
void __fastcall TForm1::BnOkWndProc(Messages::TMessage &Message)
{
if(Message.Msg==WM_PAINT){
int i;
TPoint c;
TControlCanvas * test = new TControlCanvas;
test->Control = Panel1;
for (i=0;i<=Panel1->Width;i++)
{
test->Pen->Width =Panel1->Width+100;
test->Pen->Color =TColor(RGB(i,250,500));
test->MoveTo(i,0);
test->LineTo(i,Panel1->Height );
}
SpeedButton1->Flat=true;
}
BnOKDefProc(Message);
}
这样的,我每次去点击speedbutton,都会产生重画,画面都抖动的厉害,可如果设为BnOKDefProc =panel1->WindowProc;这样的话我得speedbutton一开始就不会显示,必须等到我去点击,才会显示,而且speedbutton显示的背景并不是渐变后的颜色
--------------------next---------------------
阅读(1109) | 评论(0) | 转发(0) |