Results 1 to 6 of 6

Thread: Make CommonDialog filename non-editable

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2004
    Location
    Essex, UK
    Posts
    750

    Make CommonDialog filename non-editable

    Is there a way to make the CommonDialog filename non-editable, whilst retaining the folder browsing side of things. In other words, I want to allow the user to browse to a folder to do a "save as" but I want to fix the filename. Of course I could do that in code so that whatever the user entered as a filename would be ignored, but it would be neater if the user just couldn't change the default offering in the filename box.

    Thanks!

    BTW, coming back to VB6 after many years of .NET is more fun than I thought it would be!

  2. #2
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    Re: Make CommonDialog filename non-editable

    You might take a look at LaVolpe's CommonDialog stuff.

    Not sure if it'll do what you want out-of-the-box, but he has deconstructed the common dialog stuff rather well. And I have used his work to do several things a standard common dialog (or even a typical API common dialog) won't do, such as restrict the user to a specific set of sub-folders. So, if it won't immediately do it, you might be able to re-work it to get done what you want.

    Good luck.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  3. #3
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,057

    Re: Make CommonDialog filename non-editable

    its also pretty easy to just create your own file open/browse folder form. I actually prefer the XP style to the newer dialogs
    so I just cooked up my own. lets you control everything explicitly without much added complexity.

    https://github.com/dzzie/libs/blob/m...screenshot.jpg
    Last edited by dz32; Nov 29th, 2022 at 08:39 AM.

  4. #4
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,458

    Re: Make CommonDialog filename non-editable

    Quote Originally Posted by paulg4ije View Post
    Is there a way to make the CommonDialog filename non-editable, whilst retaining the folder browsing side of things. In other words, I want to allow the user to browse to a folder to do a "save as" but I want to fix the filename. Of course I could do that in code so that whatever the user entered as a filename would be ignored, but it would be neater if the user just couldn't change the default offering in the filename box.

    Thanks!

    BTW, coming back to VB6 after many years of .NET is more fun than I thought it would be!
    Could you not use a folder browser dialog instead? That way they could choose the location of the file but wouldn't see or be able to edit the filename.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2004
    Location
    Essex, UK
    Posts
    750

    Re: Make CommonDialog filename non-editable

    Quote Originally Posted by PlausiblyDamp View Post
    Could you not use a folder browser dialog instead? That way they could choose the location of the file but wouldn't see or be able to edit the filename.
    Quite possibly. It's been a while since I did any VB6 ;-)

    Thanks for the other suggestions too.

  6. #6
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,418

    Re: Make CommonDialog filename non-editable

    Quote Originally Posted by PlausiblyDamp View Post
    Could you not use a folder browser dialog instead? That way they could choose the location of the file but wouldn't see or be able to edit the filename.
    Couldn't he provide the "planned" Filename, say, in the Caption of the Dialog?
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width