?? 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 + -