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.SelectedPath

FolderBrowserDialog.SelectedPath

Scheduled Pinned Locked Moved C#
question
4 Posts 3 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.
  • S Offline
    S Offline
    Soulprovider
    wrote on last edited by
    #1

    I am designing a Windows Application. In the Settings class of this Application the user has to set a Directory Path to a Software program. I created a browsing button With the "FolderBrowserDialog" and with "FolderBrowserDialog.SelectedPath" I show this selected path in a textbox. Now this works, but the "FolderBrowserDialog.SelectedPath" is not remembered by the application when I restart it. How can can I store this SelectedPath? ( I also need this path as a string variable in other Classes)

    A J 2 Replies Last reply
    0
    • S Soulprovider

      I am designing a Windows Application. In the Settings class of this Application the user has to set a Directory Path to a Software program. I created a browsing button With the "FolderBrowserDialog" and with "FolderBrowserDialog.SelectedPath" I show this selected path in a textbox. Now this works, but the "FolderBrowserDialog.SelectedPath" is not remembered by the application when I restart it. How can can I store this SelectedPath? ( I also need this path as a string variable in other Classes)

      A Offline
      A Offline
      althamda
      wrote on last edited by
      #2

      You could store it in the registry. http://www.codeproject.com/cs/system/modifyregistry.asp[^]

      S 1 Reply Last reply
      0
      • S Soulprovider

        I am designing a Windows Application. In the Settings class of this Application the user has to set a Directory Path to a Software program. I created a browsing button With the "FolderBrowserDialog" and with "FolderBrowserDialog.SelectedPath" I show this selected path in a textbox. Now this works, but the "FolderBrowserDialog.SelectedPath" is not remembered by the application when I restart it. How can can I store this SelectedPath? ( I also need this path as a string variable in other Classes)

        J Offline
        J Offline
        jayart
        wrote on last edited by
        #3

        Make sure you use the same instance of FolderBrowserDialog in order the remember the settings. (A member variable or something like that)

        1 Reply Last reply
        0
        • A althamda

          You could store it in the registry. http://www.codeproject.com/cs/system/modifyregistry.asp[^]

          S Offline
          S Offline
          Soulprovider
          wrote on last edited by
          #4

          Sorry but your link gave me an internal blackout...:~ I just started programming in Visual C# using the Visual Studio manual. Sofar everything was clear, but I got stucked in how to handle my application settings. In the manual I found in the ApplicationSettingsBase this example for saving settings:
          private void Form1_FormClosing(object sender, FormClosingEventArgs e) { //Synchronize manual associations first. frmSettings1.FormText = this.Text + '.'; frmSettings1.Save(); so my questions are: 1. Are the ApplicationSettingsBase commands the way to store and reload application settings? 2. If yes: is this applicable to the problem/question in my first message? 3. where should i put this code?

          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