Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. FolderBrowserDialog

FolderBrowserDialog

Scheduled Pinned Locked Moved C#
csharpquestionworkspace
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    HUMPPAAA
    wrote on last edited by
    #1

    Hi, im developing an application in c# .net 1.1 using VS2k3. In that app I'm trying to open a System.Windows.Forms.FolderBrowserDialog. Here is the code: System.Windows.Forms.FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog(); folderBrowserDialog.SelectedPath = System.Environment.CurrentDirectory; folderBrowserDialog.ShowNewFolderButton = true; DialogResult res = folderBrowserDialog.ShowDialog(this.maindlg); if(res == DialogResult.OK) { ... //do something } It works just great, except that when I click on the "Create new directory" button, a new directory will be created, but not shown in the dialog. When I close the dialog and start it again, then the new created dir will be shown. So there is a need to refresh the directory list in the dialog when the user hits the "create new dir" button. Does anyone know how I can perform this? thx and best regards :) ~Humppa

    L H 3 Replies Last reply
    0
    • H HUMPPAAA

      Hi, im developing an application in c# .net 1.1 using VS2k3. In that app I'm trying to open a System.Windows.Forms.FolderBrowserDialog. Here is the code: System.Windows.Forms.FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog(); folderBrowserDialog.SelectedPath = System.Environment.CurrentDirectory; folderBrowserDialog.ShowNewFolderButton = true; DialogResult res = folderBrowserDialog.ShowDialog(this.maindlg); if(res == DialogResult.OK) { ... //do something } It works just great, except that when I click on the "Create new directory" button, a new directory will be created, but not shown in the dialog. When I close the dialog and start it again, then the new created dir will be shown. So there is a need to refresh the directory list in the dialog when the user hits the "create new dir" button. Does anyone know how I can perform this? thx and best regards :) ~Humppa

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      It works in my VS2003. Try to use only .ShowDialog();

      H 1 Reply Last reply
      0
      • L Lost User

        It works in my VS2003. Try to use only .ShowDialog();

        H Offline
        H Offline
        HUMPPAAA
        wrote on last edited by
        #3

        Hi, thanks for your reply. I checked it out with .ShowDialog(): System.Windows.Forms.FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog(); folderBrowserDialog.SelectedPath = System.Environment.CurrentDirectory; folderBrowserDialog.ShowNewFolderButton = true; DialogResult res = folderBrowserDialog.ShowDialog(); if(res == DialogResult.OK) { ... //do something } Unfortunatelly there is still the same problem. Please note that I'm running on WindowsXP and that the code is part of an internal class which is not inherited from UserControl or Form. ~Humppa

        1 Reply Last reply
        0
        • H HUMPPAAA

          Hi, im developing an application in c# .net 1.1 using VS2k3. In that app I'm trying to open a System.Windows.Forms.FolderBrowserDialog. Here is the code: System.Windows.Forms.FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog(); folderBrowserDialog.SelectedPath = System.Environment.CurrentDirectory; folderBrowserDialog.ShowNewFolderButton = true; DialogResult res = folderBrowserDialog.ShowDialog(this.maindlg); if(res == DialogResult.OK) { ... //do something } It works just great, except that when I click on the "Create new directory" button, a new directory will be created, but not shown in the dialog. When I close the dialog and start it again, then the new created dir will be shown. So there is a need to refresh the directory list in the dialog when the user hits the "create new dir" button. Does anyone know how I can perform this? thx and best regards :) ~Humppa

          H Offline
          H Offline
          HUMPPAAA
          wrote on last edited by
          #4

          Hi, I just found out that I've the same problem with the System.Windows.Forms.SaveFileDialog. ~Humppa

          1 Reply Last reply
          0
          • H HUMPPAAA

            Hi, im developing an application in c# .net 1.1 using VS2k3. In that app I'm trying to open a System.Windows.Forms.FolderBrowserDialog. Here is the code: System.Windows.Forms.FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog(); folderBrowserDialog.SelectedPath = System.Environment.CurrentDirectory; folderBrowserDialog.ShowNewFolderButton = true; DialogResult res = folderBrowserDialog.ShowDialog(this.maindlg); if(res == DialogResult.OK) { ... //do something } It works just great, except that when I click on the "Create new directory" button, a new directory will be created, but not shown in the dialog. When I close the dialog and start it again, then the new created dir will be shown. So there is a need to refresh the directory list in the dialog when the user hits the "create new dir" button. Does anyone know how I can perform this? thx and best regards :) ~Humppa

            H Offline
            H Offline
            HUMPPAAA
            wrote on last edited by
            #5

            Hi again, I found out that it works, when I start the application outside of VS2k3. It definitly does not work, when I start it inside of VS2k3 by hitting the "play" button. Maybe there is something wrong with my VS settings. Anyway thx ;-) ~Humppaman

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups