📄 demofrm.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "DemoFrm.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TNeoForm(Owner) //!!!注意,一定要从TNeoForm继承!
{
Sizeable = false; //设置成不可以改变大小
SetNeoMenu(0, FilePopupMenu, "文件(&F)"); //添加菜单
SetNeoMenu(1, EditPopupMenu, "编辑(&F)"); //添加菜单
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FileExitItemClick(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormKeyDown(TObject *Sender, WORD &Key,
TShiftState Shift)
{
if (Shift == (TShiftState() << ssAlt))
{
switch (toupper(Key))
{
case 'X': Close(); //因为菜单实际上都是弹出菜单,
//所以菜单热键必须自己处理。
break;
}
}
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -