⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 u8_3_2.cpp

📁 《C++ Builder 5程序设计——基础教学篇》程序源代码2.
💻 CPP
字号:
//-----------------  u8_3_2  ----------------------------------------------------------
#include <vcl.h>
#pragma hdrstop

#include "u8_3_2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
Tf8_3_2 *f8_3_2;
//---------------------------------------------------------------------------
__fastcall Tf8_3_2::Tf8_3_2(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tf8_3_2::edtInputKeyDown(TObject *Sender, WORD &Key,
      TShiftState Shift)
{
  edtInput->Text="";
  lblCtrl->Caption="";
  lblAlt->Caption="";
  lblShift->Caption="";
  if (Shift.Contains(ssAlt))
    lblAlt->Caption="Alt  龄";
  if(Shift.Contains(ssShift))
    lblShift->Caption="Shift 龄";
  if(Shift.Contains(ssCtrl))
    lblCtrl->Caption="Ctrl 龄";
  lblChar->Caption=Char(Key);
  lblAsc->Caption=IntToStr(Key);
}
//---------------------------------------------------------------------------
void __fastcall Tf8_3_2::edtInputKeyPress(TObject *Sender, char &Key)
{
  lblChar->Caption=Key;
  if (Key==13)
    lblChar->Caption="Enter" ;
  if (Key==27)
    lblChar->Caption="ESC" ;
  if (Key==20)
    lblChar->Caption="Space" ;
  lblChar->Caption=Char(Key);
  lblAsc->Caption=IntToStr(Key);
}
//---------------------------------------------------------------------------
void __fastcall Tf8_3_2::btnEndClick(TObject *Sender)
{
  Close();
}
//---------------------------------------------------------------------------


⌨️ 快捷键说明

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