GetItemPath (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This example uses a directory list box, a button, and a label on a form. When you select a directory in the directory list box and click 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.

Code

procedure TForm1.Button1Click(Sender: TObject);
begin
  DirectoryListBox1.OpenCurrent;
  Label1.Caption := DirectoryListBox1.GetItemPath(1);
end;

Uses