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. Directory Dialog Box??

Directory Dialog Box??

Scheduled Pinned Locked Moved C#
helptutorialquestion
4 Posts 4 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.
  • B Offline
    B Offline
    bania
    wrote on last edited by
    #1

    Hello.. ;) I want to make Directory Dialog Box not File Dialog Box.. (It means I want get Directory name When I select Directory name in the dialog. You Know!!) However I hardly know How to make it. :confused: Is there anyone can help me? Thanks.. I'm not who I was

    C C M 3 Replies Last reply
    0
    • B bania

      Hello.. ;) I want to make Directory Dialog Box not File Dialog Box.. (It means I want get Directory name When I select Directory name in the dialog. You Know!!) However I hardly know How to make it. :confused: Is there anyone can help me? Thanks.. I'm not who I was

      C Offline
      C Offline
      Chris Austin
      wrote on last edited by
      #2

      Using the .Net 1.1 SDK you can just use the System.Windows.Forms.FolderBrowserDialog. If you are using the 1.0 SDK you can inherit from System.Windows.Forms.Design.FolderNameEditor. This implementation will most likely require that you use a FolderNameEditor.FolderBrowser. I have a class already written that can do this job if you like. Also, I think there is at least one implementation posted here on CP. Hey don't worry, I can handle it. I took something. I can see things no one else can see. Why are you dressed like that? - Jack Burton

      1 Reply Last reply
      0
      • B bania

        Hello.. ;) I want to make Directory Dialog Box not File Dialog Box.. (It means I want get Directory name When I select Directory name in the dialog. You Know!!) However I hardly know How to make it. :confused: Is there anyone can help me? Thanks.. I'm not who I was

        C Offline
        C Offline
        chito
        wrote on last edited by
        #3

        By using FolderNameEditor class and FolderBrowser class u can make Directory Dialog Box. public class DirBrowser : FolderNameEditor { FolderBrowser fb = new FolderBrowser(); public string DirectoryPath { get { return strDirectoryPath; } } public DirBrowser() { } public DialogResult ShowDialog() { fb.Description = "Choose Directory"; fb.StartLocation = FolderBrowserFolder.MyComputer; fb.Style = FolderBrowserStyles.RestrictToFilesystem; DialogResult dlgResult = fb.ShowDialog(); if (dlgResult == DialogResult.OK) strDirectoryPath = fb.DirectoryPath; else strDirectoryPath = ""; return dlgResult; } private string strDirectoryPath = ""; } Instaniate DirBrowser class, call ShowDialog function and use DirectoryPath property to get the directory path :- DirBrowser obDirBrowser = new DirBrowser(); obDirBrowser.ShowDialog (); txtLogFilePath.Text = obDirBrowser.DirectoryPath ; Chito.

        1 Reply Last reply
        0
        • B bania

          Hello.. ;) I want to make Directory Dialog Box not File Dialog Box.. (It means I want get Directory name When I select Directory name in the dialog. You Know!!) However I hardly know How to make it. :confused: Is there anyone can help me? Thanks.. I'm not who I was

          M Offline
          M Offline
          Mazdak
          wrote on last edited by
          #4

          http://www.codeproject.com/cs/miscctrl/folderbrowser.asp[^] Mazy "And the carpet needs a haircut, and the spotlight looks like a prison break And the telephone's out of cigarettes, and the balcony is on the make And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits

          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