unit2.pas
来自「ziptv为delphi控件」· PAS 代码 · 共 60 行
PAS
60 行
Unit Unit2;
Interface
Uses
Windows,
Messages,
SysUtils,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
StdCtrls;
Type
TfrmErrorMsgs = Class(TForm)
ListBox1: TListBox;
Procedure FormKeyDown(Sender: TObject; Var Key: Word;
Shift: TShiftState);
Private
{ Private declarations }
Public
{ Public declarations }
End;
Var
frmErrorMsgs: TfrmErrorMsgs;
Implementation
{$R *.DFM}
//-------------------------------------------------------------
Procedure TfrmErrorMsgs.FormKeyDown(Sender: TObject; Var Key: Word;
Shift: TShiftState);
Var
RestoreIndex: Integer;
Begin
(* Esc Key *)
If Key = 27 Then
Close
(* Delete key *)
Else
If (Key = 46) And (ListBox1.Items.Count > 0) Then
Begin
If ListBox1.ItemIndex + 1 < ListBox1.Items.Count Then
RestoreIndex := ListBox1.ItemIndex
Else
RestoreIndex := Pred(ListBox1.ItemIndex);
ListBox1.Items.Delete(ListBox1.ItemIndex);
ListBox1.ItemIndex := RestoreIndex;
End;
End;
//-------------------------------------------------------------
End.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?