folderBrowserDialog

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I am using ver1.1 of VS2003 and I am having a problem. When I run this piece of code I get the modal dialog but no treeview. I cant understand why. Is this a bug that anyone else has seen.
if (this.folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
this.textBox1.Text = this.folderBrowserDialog1.SelectedPath;
}
Also I dont know if the openFileDialog is the same type of control, but when I replace the folderBrowserDialog with the openFileDialog and do a ShowDialog the tree control shows up????
HELP!!!!!
 
Hi,

Are you sure that you didn't confuse the two components?
FolderBrowserDialog shows tree structure while OpenFileDialog shows "open
file" dialog where you can select file(s).

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

ssd said:
Hi,
I am using ver1.1 of VS2003 and I am having a problem. When I run this
piece of code I get the modal dialog but no treeview. I cant understand
why. Is this a bug that anyone else has seen.
if (this.folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
this.textBox1.Text = this.folderBrowserDialog1.SelectedPath;
}
Also I dont know if the openFileDialog is the same type of control, but
when I replace the folderBrowserDialog with the openFileDialog and do a
ShowDialog the tree control shows up????
 
* =?Utf-8?B?c3Nk?= said:
I am using ver1.1 of VS2003 and I am having a problem. When I run this
piece of code I get the modal dialog but no treeview. I cant understand
why. Is this a bug that anyone else has seen.

if (this.folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
this.textBox1.Text = this.folderBrowserDialog1.SelectedPath;
}
Also I dont know if the openFileDialog is the same type of control,

You will have to add the 'STAThread' attribute:

\\\
[STAThread()]
public void Main()
{
 
Hi
I have the same problem in a MC++ application. When the applications contained less code tha
right now, the folderBrowserDialog worked!! Now it shows only two button and the frame, but n
tree structure, making it impossbile to choose a folder
I've also tried the [STAThread] attribute both in Form1.cpp at _tWinMain() and at the constructo
of Form1() in Form1.h
It does not fix the problem!
To mee it seems to be a bug here!!

/Thanks
 
Back
Top