问高手--圆滑边角Panel的显示问题,来者有份
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
HRGN hRgnR = CreateRoundRectRgn(0, 0, Panel1->Width, Panel1->Height, 30, 30);
SetWindowRgn(Panel1->Handle,hRgnR,TRUE);
Form1->Repaint();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormPaint(TObject *Sender)
{
struct tagLOGBRUSH lplb;
lplb.lbColor = clBlack;
lplb.lbStyle = BS_SOLID;
HBRUSH hbr = CreateBrushIndirect(&lplb);
HDC hdc = GetDC(Panel1->Handle);
HRGN hRgnR = CreateRoundRectRgn(0, 0, Panel1->Width, Panel1->Height, 30, 30);
if(FrameRgn(hdc, hRgnR, hbr, 1, 1))
Caption = "FrameRgn is OK";
else
Caption = "FrameRgn failed";
//if(PaintRgn(hdc, hRgnR1))
// Caption = "OK";
}