📄 u_matricsubjectaction.pas
字号:
unit U_MatricSubjectAction;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, ExtCtrls;
type
TFm_MatricSubjectAction = class(TForm)
Label1: TLabel;
Ed_Code: TEdit;
Label2: TLabel;
Ed_Name: TEdit;
Btn_Ok: TButton;
Btn_Cancel: TButton;
Bevel1: TBevel;
procedure Btn_OkClick(Sender: TObject);
procedure Ed_NameKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
public
end;
function Show_MatricSubjectAction(var pCode, pName: string;
Actions: integer): Boolean;
implementation
uses U_GlobalVar, U_GlobalProc;
{$R *.DFM}
function Show_MatricSubjectAction(var pCode, pName: string;
Actions: integer): Boolean;
var
Fm_MatricSubjectAction: TFm_MatricSubjectAction;
begin
Result := False;
Fm_MatricSubjectAction := TFm_MatricSubjectAction.Create(Application);
with Fm_MatricSubjectAction do
try
case Actions of
1: Caption := Caption + ' — 增加一个考试科目';
2: Caption := Caption + ' — 修改当前考试科目';
end;
Ed_Code.Text := pCode;
Ed_Name.Text := pName;
if ShowModal = mrOk then
begin
//pCode := Ed_Code.Text;
pName := Ed_Name.Text;
Result := True;
end;
finally
Free;
end;
end;
procedure TFm_MatricSubjectAction.Btn_OkClick(Sender: TObject);
begin
if Length(Ed_Name.Text) < 4 then
begin
MessageBeep(0);
U_GlobalProc.Show_ErrorMess('科目长度不能小于 4 位。');
Ed_Name.SetFocus;
Exit;
end;
ModalResult := mrOk;
end;
procedure TFm_MatricSubjectAction.Ed_NameKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (Key = VK_RETURN) and (Shift = []) then
SelectNext(ActiveControl, True, True);
end;
procedure TFm_MatricSubjectAction.FormKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
begin
if (Key = VK_ESCAPE) and (Shift = []) then
ModalResult := mrCancel;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -