DirListBoxDrive (C++)
Description
The following example assumes that a drive combo box, a file list box, and a directory list box are on a form. Add this code as the OnChange event handler for the drive combo box and the OnChange event handler for the directory list box. When you change the drive using the combo box, the directory list box and file list box will update to reflect the new drive and the current directory on that drive. When you double-click a directory in the file list box, it will update to reflect the new directory.
Code
void __fastcall TForm1::DriveComboBox1Change(TObject *Sender)
{
DirectoryListBox1->Drive = DriveComboBox1->Drive;
FileListBox1->Drive = DriveComboBox1->Drive;
FileListBox1->Directory = DirectoryListBox1->Directory;
}
void __fastcall TForm1::DirectoryListBox1Change(TObject *Sender)
{
FileListBox1->Directory = DirectoryListBox1->Directory;
}
Uses
- Vcl.FileCtrl.TDirectoryListBox.Directory ( fr | de | ja )
- Vcl.FileCtrl.TDirectoryListBox.Drive ( fr | de | ja )
- Vcl.FileCtrl.TDriveComboBox.Drive ( fr | de | ja )
- Vcl.FileCtrl.TFileListBox.Directory ( fr | de | ja )
- Vcl.FileCtrl.TFileListBox.Drive ( fr | de | ja )
- Vcl.FileCtrl.TDirectoryListBox.OnChange ( fr | de | ja )
- Vcl.StdCtrls.TCustomCombo.OnChange ( fr | de | ja )