|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
No files selected in openfiledialogHow can I test for openfiledialog OK clicked without any files being
selected? (I'm using it with multiple select as true.) I've tried if openfiledialog1.filenames = nothing then ... and if ubound(openfiledialog1.filenames) = -1 then ... but both these give compile errors. Grateful for advice. Am 11.05.2010 15:46, schrieb simonc:
> How can I test for openfiledialog OK clicked without any files being At least on Windows 7 I am not able to close the dialog by clicking the > selected? (I'm using it with multiple select as true.) > > I've tried > > if openfiledialog1.filenames = nothing then ... > > and > > if ubound(openfiledialog1.filenames) = -1 then ... > > but both these give compile errors. "OK" button if no file is selected. Maybe you are attempting to check if the "Cancel" button has been pressed? \\\ If Me.OpenFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then ... Else ... End If /// -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> |
|||||||||||||||||||||||