unit GetItemPath;

interface

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

type
  TForm1 = class(TForm)
    DirectoryListBox1: TDirectoryListBox;
    Button1: TButton;
    Label1: TLabel;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: GetItemPath
// Method: FileCtrl.TDirectoryListBox.OpenCurrent
// Method: FileCtrl.TDirectoryListBox.GetItemPath

// BeginCode
{
This example uses a directory list box, a button, and a
label on a form. When the user selects a directory in the
directory list box and clicks the button, the selected
directory opens, and the path of the second directory
displayed in the list box appears as the caption of the
label.
} 
procedure TForm1.Button1Click(Sender: TObject);
begin
  DirectoryListBox1.OpenCurrent;
  Label1.Caption := DirectoryListBox1.GetItemPath(1);
end;
// EndCode
// EndExample: GetItemPath
end.
