D
Du Dang
I'm trying to make a custom component and one of the properties required the
user to enter a path of a folder. The question is how do I allow the user to
use a "folder browser" pick the path rather than let him/her type the path
in manually (ie click on the "three dot" beside the field in visual studio
and a folder browser will pop up).
Currently this his how I code it using raw string.
[Category("AutoSaver")]
[Description(@"The directory where the setting file is stored.")]
public string SaveTo {
get {
return m_SaveTo;
}
set {
if (Directory.Exists(value)){
if (value.EndsWith("\\")){
m_SaveTo = value;
}
else {
m_SaveTo = value + "\\";
}
}
else {
m_SaveTo = System.Environment.CurrentDirectory + "\\";
}
}
}
If I'm not explaining myself cleary and confused you some how, just click on
the three dot beside "SelectedPath" property under FolderBrowserDialog
control in visual studio and you'll see what I mean.
Any help is greatly appreciated.
Thanks,
Du
user to enter a path of a folder. The question is how do I allow the user to
use a "folder browser" pick the path rather than let him/her type the path
in manually (ie click on the "three dot" beside the field in visual studio
and a folder browser will pop up).
Currently this his how I code it using raw string.
[Category("AutoSaver")]
[Description(@"The directory where the setting file is stored.")]
public string SaveTo {
get {
return m_SaveTo;
}
set {
if (Directory.Exists(value)){
if (value.EndsWith("\\")){
m_SaveTo = value;
}
else {
m_SaveTo = value + "\\";
}
}
else {
m_SaveTo = System.Environment.CurrentDirectory + "\\";
}
}
}
If I'm not explaining myself cleary and confused you some how, just click on
the three dot beside "SelectedPath" property under FolderBrowserDialog
control in visual studio and you'll see what I mean.
Any help is greatly appreciated.
Thanks,
Du