📄 unit15.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit15.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
extern int iNewWidth,iNewHeight; //新建画布宽和高
extern TColor tGroundColor; //背景色
extern int iReturnValue; //取值窗口返回值
TForm15 *Form15;
//---------------------------------------------------------------------------
__fastcall TForm15::TForm15(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm15::FormShow(TObject *Sender)
{
Shape1->Brush->Color=tGroundColor;
iReturnValue=0;
}
//---------------------------------------------------------------------------
void __fastcall TForm15::Button3Click(TObject *Sender)
{
this->Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm15::Button2Click(TObject *Sender)
{
iNewWidth=StrToInt(Edit1->Text);
iNewHeight=StrToInt(Edit2->Text);
if(iNewWidth<1||iNewWidth>1000||iNewHeight<1||iNewHeight>1000)
{
MessageBox(NULL,"宽高设置不正确,请重设,保证在1到1000之间","错误",MB_OK);
return;
}
iReturnValue=1;
tGroundColor=Shape1->Brush->Color;
this->Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm15::Button1Click(TObject *Sender)
{
if (ColorDialog1->Execute())
Shape1->Brush->Color=ColorDialog1->Color;
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -