unit3.cpp

来自「光学仪器的控制系统 用于教学和科研的仪器」· C++ 代码 · 共 43 行

CPP
43
字号
//---------------------------------------------------------------------------
#pragma hdrstop
#include <vcl.h>


#include "Unit3.h"
#include "IsNumber.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TInputConst *InputConst;
//---------------------------------------------------------------------------
__fastcall TInputConst::TInputConst(TComponent* Owner)
        : TForm(Owner)
{
 Value=0;
}
//---------------------------------------------------------------------------
void __fastcall TInputConst::ButtonOKClick(TObject *Sender)
{
 Value=StrToFloat(EditValue->Text);
 Close();        
}
//---------------------------------------------------------------------------
void __fastcall TInputConst::ButtonCancelClick(TObject *Sender)
{
 Value=0;
 Close();
}
//---------------------------------------------------------------------------
void __fastcall TInputConst::FormShow(TObject *Sender)
{
 this->ActiveControl=EditValue;        
}
//---------------------------------------------------------------------------
void __fastcall TInputConst::EditChange(TObject *Sender)
{
 TEdit *tEdit=(TEdit *)Sender;
 tEdit->Text=IsNumber(tEdit->Text);        
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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