By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,960 Members | 1,026 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,960 IT Pros & Developers. It's quick & easy.

OpenFileDialog1 and multi selection of folders

P: n/a
Noa
Hi,
Is there a way to use OpenFileDialog1 in order to multi-select folders?
I saw in msdn site a sample of multi-file-selections. I need to select
multiple folders and to apply an algorithm on them.
Any suggestions?

Thx in advance,
Dan.

Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Dan,
Have you tried the sample that was shown?

Have you tried the OpenFileDialog.Multiselect option?

If you set OpenFileDialog.Multiselect to True, you can then use
OpenFileDialog.FileNames to get the list of files.

Be certain to read the Remarks on the OpenFileDialog.Multiselect property.

http://msdn.microsoft.com/library/de...electtopic.asp

Hope this helps
Jay

"Noa" <st*********@hotmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Hi,
Is there a way to use OpenFileDialog1 in order to multi-select folders?
I saw in msdn site a sample of multi-file-selections. I need to select
multiple folders and to apply an algorithm on them.
Any suggestions?

Thx in advance,
Dan.

Nov 21 '05 #2

P: n/a
Noa
Jay,
The sample shows how multiple files can be selected at once. I have
tried it and it only works for files. I'm looking for multi-selection
of Folders. It seams that it is different. Perhaps only slightly
different and some flags should be initialized first. I don't know.
When I run the project with the sample and select some folders, one of
them (maybe the first one) is opened when Open buttun is clicked but I
don't get to the Sub OpenFileDialog1_FileOk. This is implemented only
when files are selected and Open button is clicked.
I need to select a couple of folders and apply (or "Open"). Then I need
to apply some code on each selected folder.

Any other ideas?
Thx,
Dan.
Jay B. Harlow [MVP - Outlook] wrote:
Dan,
Have you tried the sample that was shown?

Have you tried the OpenFileDialog.Multiselect option?

If you set OpenFileDialog.Multiselect to True, you can then use
OpenFileDialog.FileNames to get the list of files.

Be certain to read the Remarks on the OpenFileDialog.Multiselect property.
http://msdn.microsoft.com/library/de...electtopic.asp
Hope this helps
Jay

"Noa" <st*********@hotmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Hi,
Is there a way to use OpenFileDialog1 in order to multi-select folders? I saw in msdn site a sample of multi-file-selections. I need to select multiple folders and to apply an algorithm on them.
Any suggestions?

Thx in advance,
Dan.


Nov 21 '05 #3

P: n/a
Dan,
Doh! I missed the "Folders" part in your question, as opening multiple
folders does not make a lot of sense in most cases. I would expect
OpenFileDialog does not support it, after all it is Open *File* Dialog...
Any other ideas? Design your own dialog that adds folders to a ListBox, ListView, or possible
even a TreeView that allows multiple selections... (Unfortunately TreeView
does not allow multiple selections that I can see).

If possible I would attempt to make it look like the OpenFileDialog or the
FolderBrowserDialog controls when displayed.

Hope this helps
Jay
"Noa" <st*********@hotmail.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com... Jay,
The sample shows how multiple files can be selected at once. I have
tried it and it only works for files. I'm looking for multi-selection
of Folders. It seams that it is different. Perhaps only slightly
different and some flags should be initialized first. I don't know.
When I run the project with the sample and select some folders, one of
them (maybe the first one) is opened when Open buttun is clicked but I
don't get to the Sub OpenFileDialog1_FileOk. This is implemented only
when files are selected and Open button is clicked.
I need to select a couple of folders and apply (or "Open"). Then I need
to apply some code on each selected folder.

Any other ideas?
Thx,
Dan.
Jay B. Harlow [MVP - Outlook] wrote:
Dan,
Have you tried the sample that was shown?

Have you tried the OpenFileDialog.Multiselect option?

If you set OpenFileDialog.Multiselect to True, you can then use
OpenFileDialog.FileNames to get the list of files.

Be certain to read the Remarks on the OpenFileDialog.Multiselect

property.

http://msdn.microsoft.com/library/de...electtopic.asp

Hope this helps
Jay

"Noa" <st*********@hotmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
> Hi,
> Is there a way to use OpenFileDialog1 in order to multi-select folders? > I saw in msdn site a sample of multi-file-selections. I need to select > multiple folders and to apply an algorithm on them.
> Any suggestions?
>
> Thx in advance,
> Dan.
>

Nov 21 '05 #4

P: n/a
Noa
Thx, Jay.
Jay B. Harlow [MVP - Outlook] wrote:
Dan,
Doh! I missed the "Folders" part in your question, as opening multiple folders does not make a lot of sense in most cases. I would expect
OpenFileDialog does not support it, after all it is Open *File* Dialog...
Any other ideas? Design your own dialog that adds folders to a ListBox, ListView, or

possible even a TreeView that allows multiple selections... (Unfortunately TreeView does not allow multiple selections that I can see).

If possible I would attempt to make it look like the OpenFileDialog or the FolderBrowserDialog controls when displayed.

Hope this helps
Jay
"Noa" <st*********@hotmail.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
Jay,
The sample shows how multiple files can be selected at once. I have
tried it and it only works for files. I'm looking for multi-selection
of Folders. It seams that it is different. Perhaps only slightly
different and some flags should be initialized first. I don't know.
When I run the project with the sample and select some folders, one of them (maybe the first one) is opened when Open buttun is clicked but I don't get to the Sub OpenFileDialog1_FileOk. This is implemented only when files are selected and Open button is clicked.
I need to select a couple of folders and apply (or "Open"). Then I need to apply some code on each selected folder.

Any other ideas?
Thx,
Dan.
Jay B. Harlow [MVP - Outlook] wrote:
Dan,
Have you tried the sample that was shown?

Have you tried the OpenFileDialog.Multiselect option?

If you set OpenFileDialog.Multiselect to True, you can then use
OpenFileDialog.FileNames to get the list of files.

Be certain to read the Remarks on the OpenFileDialog.Multiselect

property.

http://msdn.microsoft.com/library/de...electtopic.asp

Hope this helps
Jay

"Noa" <st*********@hotmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
> Hi,
> Is there a way to use OpenFileDialog1 in order to multi-select

folders?
> I saw in msdn site a sample of multi-file-selections. I need to

select
> multiple folders and to apply an algorithm on them.
> Any suggestions?
>
> Thx in advance,
> Dan.
>


Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.