473,671 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Selecting a directory with the Common Dialog

Djeek
8 New Member
I tried to use the Common Dialog for choosing directories like many programs do but I did not manage it. You always have to select a file but I don't want to see/select files, only directories!
Earlier posts on this issue were not (proper) answered.
I searched the MSDN Library, Internet and this forum but found no answers...
Please...
Feb 17 '08 #1
10 9158
jamesd0142
469 Contributor
What version of vb are you using?

There is a:
"FolderBrowserD ialog"
in vb 2005

which would solve you problem
Feb 18 '08 #2
debasisdas
8,127 Recognized Expert Expert
You can still use the VB 6.0

Try to find the location of the file using the CD control.

Try to remove file name part and you will get the directory.
Feb 18 '08 #3
Djeek
8 New Member
I tried to use the Common Dialog for choosing directories like many programs do but I did not manage it. You always have to select a file but I don't want to see/select files, only directories!
Earlier posts on this issue were not (proper) answered.
I searched the MSDN Library, Internet and this forum but found no answers...
Please...
Both thanks for reply.
Stripping the file from the path is no problem but I don't want to navigate files debasisdas.
That "FolderBrowserD ialog" sounds interesting jamesd0142! I don't know it. Is it a custom control? Does it still exist in VB6? MSDN Library does not know it.
How can I invoke it? I'm using VB6 6.0.8169.
grts
Feb 18 '08 #4
jamesd0142
469 Contributor
Both thanks for reply.
Stripping the file from the path is no problem but I don't want to navigate files debasisdas.
That "FolderBrowserD ialog" sounds interesting jamesd0142! I don't know it. Is it a custom control? Does it still exist in VB6? MSDN Library does not know it.
How can I invoke it? I'm using VB6 6.0.8169.
grts
I never used VB6 although I do know VB 2005 is a later version, much closer to VB.NET.

Im sure Killer42 would have an answer to your latest question however.

James
Feb 19 '08 #5
Djeek
8 New Member
Its disappointing not finding answers here... but all who repied: THANKS!
Mar 6 '08 #6
debasisdas
8,127 Recognized Expert Expert
Have you tried working on as suggested in Post #3
Mar 6 '08 #7
Djeek
8 New Member
I dont know if I have a CD control. I can not find such control in my VB6 installation. It isnt the multimedia control I suppose.
But... I (the user) dont want to have to choose a FILE at first and stripping it from the path. I even dont want show the files in the directories! Stripping the path is also possible with the standard Common Dialog!
Many programs offer the possibility to choose a DIRECTORY. Thats all, but HOW?
Mar 10 '08 #8
debasisdas
8,127 Recognized Expert Expert
Have you tried using Drive Listbox and directory listbox.
Mar 10 '08 #9
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

This code will allow you to select the Directory..

Expand|Select|Wrap|Line Numbers
  1.     With cdlg
  2.         .Flags = cdlOFNPathMustExist
  3.         .Flags = .Flags Or cdlOFNHideReadOnly
  4.         .Flags = .Flags Or cdlOFNNoChangeDir
  5.         .Flags = .Flags Or cdlOFNExplorer
  6.         .Flags = .Flags Or cdlOFNNoValidate
  7.         .FileName = "*.txyz"   'Dummy File
  8.         .CancelError = True
  9.         '
  10.         On Error Resume Next
  11.         .Action = 1
  12.         If Err = 0 Then
  13.             MsgBox Left(.FileName, Len(.FileName) - 7)
  14.         End If
  15.     End With
  16.  
This flag : cdlOFNNoValidat e allows you to get the Browsed Path, even if no File is Selected

Regards
Veena
Mar 10 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

5
6498
by: John Lauwers | last post by:
Hello, Is there a way to move the commondialog to a specific position ? Greets John
6
1867
by: E Pease | last post by:
I have been trying to edit the Explorer example by Dev Ashish I found on www.msvp.org (I think). I have been all over the net so I am not quite sure where the file came from. I like the way it works but I can not find a way to tell it to display a certain directory. I want it to display a folder on our share drive. I know the path for the directory. I want users to be able to open any files below the parent directory I tell it to start in....
2
1822
by: Boris | last post by:
Hi, I have recently learned from a kind MVP that VS .NET 2002 won't use .NET framework 1.1 which in turn prevents me from utilizing the FolderBrowserDialog class since it is only available in the .NET framework 1.1 so I was wondering if anyone would know how to let the user browse and select directories through a dialog window or otherwise short of having them type in the directory they are interested having some kind of operation...
3
4133
by: CaribSoft | last post by:
I want to create my own common dialog to use in an application . How do I show a custom dialog (form) in a class based on the common dialog class?
23
6990
by: George | last post by:
Is there a way to customize the open file common dialog? I am trying to modify the button text so I can create a delete file common dialog. I need the same functionality of the open file common dialog but just need to change the button text from "open" to "delete". Any ideas? Thanks
4
2449
by: Ram Baruch | last post by:
Hi, I'm looking for a simple directory picker. I need both local drives directories and directories in the computers in the network neighborhood. Does anyone know if there is something ready in the .net framework or a good implementation of it? Thanks, Ram.
0
1371
by: Bo Gusman | last post by:
A curious problem, one that I think I've seen before. I have a .250 MLOC vb6 app that uses the common dialog control. If I select File/Open in my app to display the file open dialog and then alt-tab to another running app, when I try to alt-tab back to my app, the common dialog box and my apps main window is gone (can't see it in the task bar, or in the alt-tab window). If I then maximize another window and minimize it again, my app and...
6
1916
by: Steve Barnett | last post by:
I need to include a wizard in my application that will, as one of the steps, ask the user to select a file to open and (later) a file to save it as. The naff way to do this would be to have a button on the form that pops-up the common dialog. The cool way to do this would be to have the common dialog embedded in the wizard. I know it's possible, as I've seen other apps do this kind of thing, but I have no ideas how it can be achieved and...
3
1507
by: =?Utf-8?B?SXZhbg==?= | last post by:
Hello. I'd like to ask, if there is some common dialog box for selecting directory (like CFileDialog class). Thanks.
0
8390
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8596
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8667
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7428
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6222
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4221
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4399
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1801
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.