Главная страница | назад





Article #16985: Refreshing the TDriveComboBox drive list

 Question and Answer Database

FAQ1985D.txt   Refreshing the TDriveComboBox drive list
Category   :VCL
Platform    :All
Product    :All 32 bit  

Question:
How can I get the TDriveComboBox component to refresh its' list,
given that networked drives can be added, deleted, and remapped, and
drives can be hot swapped by using plug and play devices?

Answer:
The following example demonstrates surfacing the protected
BuildList() method of the TDriveComboBox component to regenerate the
list of current disk drives.

Example:

type
  TNewDriveComboBox = class(TDriveComboBox)
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  Drive : char;
begin
  Drive := DriveComboBox1.Drive;
  TNewDriveComboBox(DriveComboBox1).BuildList;
  DriveComboBox1.Drive := Drive;
end;


7/16/98 4:31:28 PM
 

Last Modified: 01-SEP-99