三角形,圆形按钮的创建
哪位高手帮帮忙,解决一下问题,谢谢
代码:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{//创建圆形
HRGN hRgnR=CreateEllipticRgn(0,0,Button1->Width,Button1->Height);
SetWindowRgn(Button1->Handle,hRgnR,TRUE);
// 创建三角形
TrPoint[0].x=Button2->Width/2;
TrPoint[0].y=0;
TrPoint[1].x=0;
TrPoint[1].y=Button2->Height;
TrPoint[2].x=Button2->Width;
TrPoint[2].y=Button2->Height;
HRGN hRgnT=CreatePolygonRgn(TrPoint,3,ALTERNATE);
SetWindowRgn(Button2->Handle,hRgnT,TRUE);
}
//---------------------------------------------------------------------------
错误提示:
Build
[C++ Error] Unit1.h(11): E2040 Declaration terminated incorrectly
[C++ Error] Unit1.cpp(22): E2451 Undefined symbol 'TrPoint'