View Single Post
  #386  
Old 04-10-2023, 04:54
hitman797's Avatar
hitman797 hitman797 is offline
Registered User
 
Join Date: Feb 2013
Location: Algeria
Posts: 168
Thanks: 486
Thanked 202 Times in 122 Posts
hitman797 is on a distinguished road
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;
Attached Images
File Type: png Capture.PNG (17.0 KB, 130 views)

Last edited by hitman797; 07-10-2023 at 05:49.
Reply With Quote
The Following 2 Users Say Thank You to hitman797 For This Useful Post:
audiofeel (04-10-2023), Lord.Freddy (04-10-2023)