FolderBrowserDialog is empty

D

Davy Brion

Hey,

i'm sure i overlooked something silly, but for some reason if i try to
use the FolderBrowserDialog.ShowDialog method, the dialog does not
show a treeview containing folders... the dialog only contains the
button to create a new folder (which also doesn't do anything) and
the Ok and Cancel buttons.

I get this behaviour no matter what value i assign to the RootFolder
property before calling the ShowDialog method.

Does anyone know what i'm doing wrong here?

thx

ps: using .NET 1.1 with SP1 on XP Pro SP2

--
 
H

Herfried K. Wagner [MVP]

* "Davy Brion said:
i'm sure i overlooked something silly, but for some reason if i try to
use the FolderBrowserDialog.ShowDialog method, the dialog does not
show a treeview containing folders... the dialog only contains the
button to create a new folder (which also doesn't do anything) and
the Ok and Cancel buttons.

Make sure the 'STAThread' attribute is specified on your application's
entry point (not 'MTAThread'). 'STAThread' is the default, so it
doesn't need to be explicitly added to your 'void Main'/'Sub Main'.
 
D

Davy Brion

Make sure the 'STAThread' attribute is specified on your application's
entry point (not 'MTAThread'). 'STAThread' is the default, so it
doesn't need to be explicitly added to your 'void Main'/'Sub Main'.

thx, that fixed it :)

--
 
J

Joey Callisay

Any article or links which discusses this behavior for folderbrowserdialog
on Multithreaded apps Mr. Wagner?

Thanx...
 
H

Herfried K. Wagner [MVP]

* "Joey Callisay said:
Any article or links which discusses this behavior for folderbrowserdialog
on Multithreaded apps Mr. Wagner?

I don't have an article in mind, but for Windows Forms Apps I'd use
'STAThread' to avoid problems when components make use of COM interop.
 
J

Joey Callisay

ok thanx

Herfried K. Wagner said:
I don't have an article in mind, but for Windows Forms Apps I'd use
'STAThread' to avoid problems when components make use of COM interop.
 

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