FolderBrowserDialog

Hello,
I added a folder browser dlg to my form, but it just comes up gray...no window with the folder directory. I created a test form with nothing in it besides a button to showdialog the folder browser, and it worked, but for some reason in my other project it just comes up gray.
I know this is pretty ambiguous, but anyone have any ideas
Thanks!

Joe


Answer this question

FolderBrowserDialog

  • dhanasekar

    Thank you for your answer.

    I already read an acticle about that problem.

    But what I'm trying to do is different. It's inside a Visual Studio macro.

    It's probably the same kind of problem, but with the macro I don't know what to do.


  • KitZ_CK

    Check you have STAThreadAttribute applied to your entry point, for example:



    [STAThread]
    private static void Main()
    {
    Application.Run(new Form());
    }



  • Zentik

    You need to start up a new STA thread and block until that thread returns, see the second answer of this thread: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=353846&SiteID=1.

  • FolderBrowserDialog