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

📄 unitwordlist.pas

📁 迷你单词Delphi版全源吗
💻 PAS
字号:
unit UnitWordList;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TFrmWordList = class(TForm)
    ListBox1: TListBox;
    Button1: TButton;
    Button2: TButton;
    procedure FormResize(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure ListBox1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    Procedure CreateParams(Var Params: TCreateParams); Override;
  end;

var
  FrmWordList: TFrmWordList;

implementation

uses UnitMain;

{$R *.dfm}

Procedure TFrmWordList.CreateParams(Var Params:TCreateParams);
Begin
  inherited CreateParams( Params);
  with params do
  begin
    ExStyle := Params.ExStyle or WS_EX_TOPMOST or WS_EX_TOOLWINDOW;
    WndParent := FrmMain.Handle;
  end
End;

procedure TFrmWordList.FormResize(Sender: TObject);
begin
   ListBox1.Width:=FrmWordList.Width-25;
   ListBox1.Height:=FrmWordList.Height-80;
   Button1.Top:=FrmWordList.Height-58;
   Button2.Top:=FrmWordList.Height-58;
end;

procedure TFrmWordList.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
 Action:=cafree;
 FrmWordList:=nil;
end;

procedure TFrmWordList.Button1Click(Sender: TObject);
begin
close;
end;

procedure TFrmWordList.Button2Click(Sender: TObject);
var tmpStr:String;
tmpint:integer;
begin
  if not ListBox1.ItemIndex>0 then exit;
  tmpStr:=ListBox1.Items[ListBox1.itemindex];
  tmpint:=StrToInt(copy(tmpStr,0,POS(':',tmpStr)-1)) ;
  FrmMain.RSIndex:=tmpint-2;
end;

procedure TFrmWordList.ListBox1Click(Sender: TObject);
begin
Button2.Click;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -