lcform.cpp

来自「一个开发组件,非规则性的窗体开发,很好用~!」· C++ 代码 · 共 67 行

CPP
67
字号
//                              《不规则窗体组件》
//                              作者:林华锋
//                              版权:LC工作室
//                              日期:2000/05
//                              修改:2000/05
//
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop

#include "LcForm.h"
#pragma package(smart_init)
//---------------------------------------------------------------------------
// ValidCtrCheck is used to assure that the components created do not have
// any pure virtual functions.
//
static inline void ValidCtrCheck(TLcForm *)
{
        new TLcForm(NULL);
}
//---------------------------------------------------------------------------
__fastcall TLcForm::TLcForm(TComponent* Owner)
        : TImage(Owner)
{
Align=alClient;
Stretch=true;
CanElliptic=true;
if(ComponentState.Contains(csDesigning))
{
ShowMessage("LcForm正处于设计阶段!");
}
else
{
ShowMessage("LcForm正处于运行阶段!");
}
}
//---------------------------------------------------------------------------
namespace Lcform
{
        void __fastcall PACKAGE Register()
        {
                 TComponentClass classes[1] = {__classid(TLcForm)};
                 RegisterComponents("Samples", classes, 0);
        }
}
//---------------------------------------------------------------------------
void __fastcall TLcForm::CreateEllipticForm(void)
{
if(CanElliptic)
{
HRGN hRgn=CreateEllipticRgn(0,0,Parent->Width,Parent->Height);
SetWindowRgn(Parent->Handle,hRgn,true);
}
}
//---------------------------------------------------------------------------
void __fastcall TLcForm::CreateEllipticForm(int x1,int y1,int x2,int y2)
{
if(CanElliptic)
{
HRGN hRgn=CreateEllipticRgn(x1,y1,x2,y2);
SetWindowRgn(Parent->Handle,hRgn,true);
}
}
//---------------------------------------------------------------------------


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?