RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDirectoryListBox.OpenCurrent Method

Opens the selected directory.

Pascal
procedure OpenCurrent;
C++
__fastcall OpenCurrent();

OpenCurrent opens the directory selected in the directory list box, as if the user had double-clicked the directory.  

C++ Examples: 

 

/*
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.
*/
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  DirectoryListBox1->OpenCurrent();
  Label1->Caption = DirectoryListBox1->GetItemPath(1);
}

 

Delphi Examples: 

{
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;

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!