I'm trying to write a Visual Studio.net 2003 macro that will display a FolderBroswer Dialog. When the code below executes, the FolderBrowser dialog is displayed with 3 buttons (Ok, Cancel, New Folder), but there is no tree control displaying directories
Sub SetSandboxRoot(
Dim FindSandboxPathDlg As New System.Windows.Forms.FolderBrowserDialo
REM FindSandboxPathDlg.Description = "Select the directory where your sandbox is located.
REM FindSandboxPathDlg.ShowNewFolderButton = Fals
FindSandboxPathDlg.ShowDialog(
End Su
I've tried many combinations of setting various properties before calling ShowDialog but the result is the same
Can anyone please help!
Thanks
Chris
>I'm trying to write a Visual Studio.net 2003 macro that will display a FolderBroswer Dialog. When the code below executes, the FolderBrowser dialog is displayed with 3 buttons (Ok, Cancel, New Folder), but there is no tree control displaying directories.
>
[quoted text clipped - 8 lines]
>
>Can anyone please help!!
I pasted your code into a new VB.Net project and ran it
BrowseDialog appeared with the treeview
Sounds like something may be corrupt in your installation
Vin
CBROC - 26 Feb 2004 18:01 GMT
Vince
Thanks for taking the time to try my code in a vb.net application.
As I mention in my original post, I'm trying to use the Folder Browser dialog from a VS.NET macro. Maybe that is part of the issue? I've seen some posts concerning the use of the [STAThread] attribute on the method that displays the dialog. Since I can't set this attribute on macro functions, I'm now thinking that I may have to write a VS.NET addin (DLL) to get and call that from the macro to get the dialog to display
I've had no trouble displaying other common dialogs (like the FileOpen dialog) from macro code. I have no clue why displaying Folder Browser Dialog from macro code should be so different or difficult
Thank
Vincent Finn - 27 Feb 2004 19:25 GMT
>Vince,
>
>Thanks for taking the time to try my code in a vb.net application.
>
>As I mention in my original post, I'm trying to use the Folder Browser dialog from a VS.NET macro. Maybe that is part of the issue? I've seen some posts concerning the use of the [STAThread] attribute on the method that displays the dialog. Since I can't set this attribute on macro functions, I'm now thinking that I may have to write a VS.NET addin (DLL) to get and call that from the macro to get the dialog to display.
Sorry missed that
>I've had no trouble displaying other common dialogs (like the FileOpen dialog) from macro code. I have no clue why displaying Folder Browser Dialog from macro code should be so different or difficult.
You could try using PInvoke to call the API directly instead.
Vin