参考MSDN上的一篇文章,有代码下载.HOWTO: Implement a Managed Component that Wraps the Browse For Folder Common
Dialog Box by Using Visual C# .NET", 
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q306285

解决方案 »

  1.   

    选择文件夹的对话框 
    已修改,加入命名空间 
    using System; 
    using System.Windows.Forms; 
    using System.Windows.Forms.Design;   //重要 namespace oztime.smart.streammedia 

       public class FolderDialog : FolderNameEditor  
       {  
          FolderNameEditor.FolderBrowser fDialog = new System.Windows.Forms.Design.FolderNameEditor.FolderBrowser();  
          public FolderDialog()  
          {  
          }  
          public DialogResult DisplayDialog()  
          {  
             return DisplayDialog("请选择一个文件夹");  
          }  
              
          public DialogResult DisplayDialog(string description)  
          {  
             fDialog.Description = description;  
             return fDialog.ShowDialog();  
          }  
          public string Path   
          {  
             get   
             {  
                return fDialog.DirectoryPath;  
             }  
          }  
              
          ~FolderDialog()  
          {  
             fDialog.Dispose();  
          }  
       }   }
      

  2.   

    使用方法: FolderDialog f = new FolderDialog(); 
    if(f.DisplayDialog() != DialogResult.OK) 

       return; 

    this.txtSavePath.Text = f.Path; 
    ///////////要在资源管理器中引用那个System.Design.dll文件
      

  3.   

    3x both.
    TheAres(班门斧) 的我试验过了,可以.To poetc(伊公子):
    为什么我用用你的方法,不显示目录,只有三个按钮在那个窗口中?
    新建,确定,取消.
      

  4.   

    要在资源管理器中引用那个System.Design.dll文件你加这个了吧?我一直用的好好的呀;你把代码贴出来看看.