u8_2_1.cpp

来自「《C++ Builder 5程序设计——基础教学篇》程序源代码2.」· C++ 代码 · 共 49 行

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

#include "U8_2_1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
Tf8_2_1 *f8_2_1;
//---------------------------------------------------------------------------
__fastcall Tf8_2_1::Tf8_2_1(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tf8_2_1::FormActivate(TObject *Sender)
{
   edtUpper->SetFocus();
}
//---------------------------------------------------------------------------
void __fastcall Tf8_2_1::edtUpperKeyPress(TObject *Sender, char &Key)
{
  if (Key>=97 && Key<=122)
  {
     Key-=32;
  }
  if (Key==VK_RETURN)
  {
    Key=0;
    PostMessage(Handle,WM_NEXTDLGCTL,0,0);
  }
}
//---------------------------------------------------------------------------
void __fastcall Tf8_2_1::edtLowerKeyPress(TObject *Sender, char &Key)
{
   if (Key>=65 && Key<=90)
    {
      Key+=32;
    }
   if (Key==VK_RETURN)
    {
      Key=0;
      edtNum->SetFocus();
    }
}
//---------------------------------------------------------------------------
void __fastcall Tf8_2_1::edtNumKeyPress(TObject *Sender, char &Key)
{
  if (Key<48 || Key>57)  //獶计

⌨️ 快捷键说明

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