-
Nov 29th, 2022, 06:29 AM
#1
Thread Starter
Fanatic Member
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!
-
Nov 29th, 2022, 08:19 AM
#2
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.
-
Nov 29th, 2022, 08:35 AM
#3
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.
-
Nov 29th, 2022, 08:36 AM
#4
Re: Make CommonDialog filename non-editable
Originally Posted by paulg4ije
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.
-
Nov 29th, 2022, 08:57 AM
#5
Thread Starter
Fanatic Member
Re: Make CommonDialog filename non-editable
Originally Posted by PlausiblyDamp
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.
-
Nov 29th, 2022, 09:05 AM
#6
Re: Make CommonDialog filename non-editable
Originally Posted by PlausiblyDamp
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|