Code:
var
Form4: TForm4;
Directory: TDirectoryListBox;
Drive: TDriveComboBox;
FileList: TFileListBox;
Code:
procedure TForm4.FormCreate(Sender: TObject);
begin
// Directory
Directory:= TDirectoryListBox.Create(nil);
Directory.ParentWindow:=FmxHandleToHWND(Form4.Handle);
Directory.Visible:=False;
Directory.FileList:=FileList;
// Drive
Drive:= TDriveComboBox.Create(nil);
Drive.ParentWindow:=FmxHandleToHWND(Form4.Handle);
Drive.Visible:=False;
Drive.TextCase:=tcUpperCase;
Drive.DirList:=Directory;
// FileList
FileList:= TFileListBox.Create(nil);
FileList.ParentWindow:=FmxHandleToHWND(Form4.Handle);
FileList.Visible:=False;
//
ListBox1.Items:= Directory.Items;
ListBox2.Items:= FileList.Items;
ComboBox1.Items:= Drive.Items;
end;
Code:
procedure TForm4.ComboBox1Change(Sender: TObject);
begin
Drive.ItemIndex:= ComboBox1.ItemIndex;
end;
procedure TForm4.ListBox1ItemClick(const Sender: TCustomListBox;
const Item: TListBoxItem);
begin
ListBox1.BeginUpdate;
ListBox1.Items:= Directory.Items;
ListBox1.EndUpdate;
end;
procedure TForm4.ListBox2ItemClick(const Sender: TCustomListBox;
const Item: TListBoxItem);
begin
ListBox2.BeginUpdate;
ListBox2.Items:= FileList.Items;
ListBox2.EndUpdate;
end;