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

📄 unit2.pas

📁 ziptv为delphi控件
💻 PAS
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -