selectfromlistdialog.pas

来自「EhLib 4.2.16 中文汉化版 (Faceker.com 修改版) 」· PAS 代码 · 共 54 行

PAS
54
字号
{*******************************************************}
{                                                       }
{                     EhLib v4.0                        }
{                                                       }
{             TfSelectFromListDialog form               }
{                                                       }
{     Copyright (c) 2004-2005 by Dmitry V. Bolshakov    }
{                                                       }
{*******************************************************}

unit SelectFromListDialog;

interface

uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls, 
  Buttons, ExtCtrls;

type
  TfSelectFromListDialog = class(TForm)
    OKBtn: TButton;
    CancelBtn: TButton;
    Bevel1: TBevel;
    ListBox1: TListBox;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  fSelectFromListDialog: TfSelectFromListDialog;

function SelectFromList(Items: TStrings): Integer;

implementation

{$R *.dfm}

function SelectFromList(Items: TStrings): Integer;
var
  f: TfSelectFromListDialog;
begin
  Result := -1;
  f := TfSelectFromListDialog.Create(nil);
  f.ListBox1.Items := Items;
  if f.ShowModal = mrOk then
  begin
    Result := f.ListBox1.ItemIndex;
  end;
  f.Free;
end;

end.

⌨️ 快捷键说明

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