How to identify a FolderBrowserDialog?

H

hotmit

I'm trying to create a program that dynamicly saves and loads path of a
FolderBrowserDialog , but I ran into a problem. Since
FolderBrowserDialog is not a Control, therefore it doesn't have
attribute such as Name. How do I get the name of a Component or unique
string to identify each FolderBrowserDialog instances in the my form.
I tried GetHashCode() but that doesn't work out too well.

Any suggestion is apreaciated!!!

Thanks
 
N

Nicholas Paldino [.NET/C# MVP]

I don't understand why you have multiple instances of a
FolderBrowserDialog. It's a dialog, meaning it is modal, which means that
only one dialog can be shown at a time.

Given this, why do you have multiple instances? Do you have a bunch of
different settings? If this is the case, I would just have a structure or a
class which holds the settings, and key those by whatever name you wish.

Hope this helps.
 
H

hotmit

I want to user multiple instances of the FolderBrowserDialog so I won't
lose the "SelectedPath" value between them
 
N

Nicholas Paldino [.NET/C# MVP]

That's a waste of a good deal of resources just to store that. Why not
store the path as a string and then set the properties of the dialog when
you need to?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top