TFrame控件背景自绘
(1)在Frame框架窗口中增加 TApplicationEvent 对象
(2)响应 TApplicationEvent 的 Message 消息
(3)编写 WM_PAINT 消息的代码:
void __fastcall TFrame1::ApplicationEvents1Message(tagMSG &Msg,
bool &Handled)
{
switch(Msg.message)
{
case WM_PAINT://自绘
gdip::Graphics gdi(this->Handle);
gdip::SolidBrush bsh(gdip::Color(195,243,229));
gdip::Rect rect(0,0,this->Width,this->Height);
gdi.FillRectangle(&bsh,rect);
break;
}
}


浙公网安备 33010602011771号