Double-click a folder browser dialog?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David Veeneman

    #1

    Double-click a folder browser dialog?

    I'm trying to implement some fairly standard behavior (or so I thought) on a
    FolderBrowserDi alog component. double-clicking a folder in the dialog should
    have the same effect as selecting the folder and clicking the dialog's OK
    button. But the FolderBrowserDi alog component doesn't implement that
    behavior, and it doesn't have a double-click event that would allow me to
    implement it.

    Is there a simple way to implement this behavior? Thanks.


  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Double-click a folder browser dialog?

    David,

    Unfortunately, this isn't made available to you. It's not even
    available through the API call SHBrowseForFold er (which is what the
    FolderBrowserDi alog calls, ultimately). You could try and derive from
    FolderBrowserDi alog, and replace the hook procedure (HookProc) as well as
    the RunDialog procedure and then get the window handle for the tree view,
    but that's VERY implementation specific, and I wouldn't depend on it.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "David Veeneman" <davidv@nospam. comwrote in message
    news:%23ktfwN2B IHA.484@TK2MSFT NGP06.phx.gbl.. .
    I'm trying to implement some fairly standard behavior (or so I thought) on
    a FolderBrowserDi alog component. double-clicking a folder in the dialog
    should have the same effect as selecting the folder and clicking the
    dialog's OK button. But the FolderBrowserDi alog component doesn't
    implement that behavior, and it doesn't have a double-click event that
    would allow me to implement it.
    >
    Is there a simple way to implement this behavior? Thanks.
    >

    Comment

    • Ignacio Machin \( .NET/ C# MVP \)

      #3
      Re: Double-click a folder browser dialog?

      Hi,

      "David Veeneman" <davidv@nospam. comwrote in message
      news:%23ktfwN2B IHA.484@TK2MSFT NGP06.phx.gbl.. .
      I'm trying to implement some fairly standard behavior (or so I thought) on
      a FolderBrowserDi alog component. double-clicking a folder in the dialog
      should have the same effect as selecting the folder and clicking the
      dialog's OK button. But the FolderBrowserDi alog component doesn't
      implement that behavior, and it doesn't have a double-click event that
      would allow me to implement it.
      Unfortunatelly that feature is not available, not only that but
      FolderBrowserDi alog is a sealed class, so you cannot inherit from it.

      You either implement your own FolderBrowserDi alog from the scratch or look
      around for a third party implementation


      Comment

      • Ignacio Machin \( .NET/ C# MVP \)

        #4
        Re: Double-click a folder browser dialog?


        "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard .caspershouse.c omwrote in
        message news:%23mMwMt2B IHA.4568@TK2MSF TNGP02.phx.gbl. ..
        David,
        >
        Unfortunately, this isn't made available to you. It's not even
        available through the API call SHBrowseForFold er (which is what the
        FolderBrowserDi alog calls, ultimately). You could try and derive from
        FolderBrowserDi alog,
        IIRC FolderBrowserDi alog is a sealed class.

        Yep, it says so in the MSDN:
        http://msdn2.microsoft.com/en-us/lib...serdialog.aspx


        Comment

        • Nicholas Paldino [.NET/C# MVP]

          #5
          Re: Double-click a folder browser dialog?

          That sucks. In that case, the OP should extend CommonDialog and call
          SHBrowseForFold er, and try to find the tree view window, or like you said,
          get a third party implementation.


          --
          - Nicholas Paldino [.NET/C# MVP]
          - mvp@spam.guard. caspershouse.co m

          "Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions .comwrote in
          message news:uZGIkq4BIH A.5044@TK2MSFTN GP03.phx.gbl...
          >
          "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard .caspershouse.c omwrote
          in message news:%23mMwMt2B IHA.4568@TK2MSF TNGP02.phx.gbl. ..
          >David,
          >>
          > Unfortunately, this isn't made available to you. It's not even
          >available through the API call SHBrowseForFold er (which is what the
          >FolderBrowserD ialog calls, ultimately). You could try and derive from
          >FolderBrowserD ialog,
          >
          IIRC FolderBrowserDi alog is a sealed class.
          >
          Yep, it says so in the MSDN:
          http://msdn2.microsoft.com/en-us/lib...serdialog.aspx
          >

          Comment

          • G Himangi

            #6
            Re: Double-click a folder browser dialog?

            >>or look around for a third party implementation

            Take a look at Shell MegaPack controls from http://www.ssware.com

            G Himangi


            "Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions .comwrote in
            message news:ux4V%23p4B IHA.3900@TK2MSF TNGP02.phx.gbl. ..
            Hi,
            >
            "David Veeneman" <davidv@nospam. comwrote in message
            news:%23ktfwN2B IHA.484@TK2MSFT NGP06.phx.gbl.. .
            >I'm trying to implement some fairly standard behavior (or so I thought)
            >on a FolderBrowserDi alog component. double-clicking a folder in the
            >dialog should have the same effect as selecting the folder and clicking
            >the dialog's OK button. But the FolderBrowserDi alog component doesn't
            >implement that behavior, and it doesn't have a double-click event that
            >would allow me to implement it.
            >
            Unfortunatelly that feature is not available, not only that but
            FolderBrowserDi alog is a sealed class, so you cannot inherit from it.
            >
            You either implement your own FolderBrowserDi alog from the scratch or
            look around for a third party implementation
            >

            Comment

            Working...