You receive a "Too many files selected" error message when you use the OpenFileDialog control (820631)
The information in this article applies to:
- Microsoft Visual Basic 2005
- Microsoft Visual Basic .NET (2003)
- Microsoft Visual Basic .NET (2002)
- Microsoft Visual C# .NET (2003)
- Microsoft Visual C# .NET (2002)
SYMPTOMSYou may have a Windows Form with an OpenFileDialog control, and the Multiselect property of the control is set to True. When you run your
application, and you try to open more than 200 files, you may receive the
following error message: An unhandled exception
of type 'System.InvalidOperationException' occurred in
system.windows.forms.dll Additional information: Too many files selected.
Please select fewer files and try again. CAUSEThis problem occurs because the application uses the Open
File common dialog box with the OFN_ALLOWMULTISELECT flag set. The buffer that
is passed to the Open File common dialog box in the OPENFILENAME.lpstrFile
field is too small. Therefore, the GetOpenFileName function
returns an error value, and you
receive the error message when you try to open more than 200
files.STATUS This
behavior is by design.
Modification Type: | Minor | Last Reviewed: | 10/3/2006 |
---|
Keywords: | kbvs2005swept kbvs2005applies kbDlg kbProperties kbCtrl kbControl kbForms kbWindowsForms kbprb KB820631 kbAudDeveloper |
---|
|