From: "patrick allen" Newsgroups: borland.public.delphi.vcl.components.using References: <3b0dda39_1@dnews> Subject: Re: DriveComboBox "I/O Error 21" Date: Mon, 28 May 2001 22:42:01 -0400 Lines: 32 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 NNTP-Posting-Host: 216.127.140.114 Message-ID: <3b130c30_2@dnews> X-Trace: dnews 991104048 216.127.140.114 (28 May 2001 19:40:48 -0700) Path: dnews Xref: dnews borland.public.delphi.vcl.components.using:78401 kai, the following event handler responds to the drive box change event and handles the IO21 error gracefully. procedure TForm1.MydrivecomboboxChange(Sender: TObject); begin try Mydirectorylistbox.drive := Mydrivecombobox.drive; except on EInOutError do messagedlg(#13 + 'the selected drive, or device is not ready'+ #13, mtwarning, [mbok], 0); end; end; ...good luck, patrick Kai Peters wrote in message news:3b0dda39_1@dnews... > When I cursor onto an inaccessible drive (ie CDROM drive), I encounter > this error. Is there a way to handle this before it turns ugly? (Please > note: I have to use a drivecombobox. A Browse for folder dialog is NOT an > option). I was not able to capture the error through the OnChange or > KeyDown events > > TIA > > Darrell Funk