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

📄 selectfromlistdialog.pas

📁 最新的 DBGRIDEH4.0
💻 PAS
字号:
{*******************************************************}
{                                                       }
{                     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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -