Directory trees in List boxes

I am new to visual C++ and I am having a few problems.  Is it possible to have two list boxes on a dialog form where one displays the directory structure and the other displays the contents of the selected directory and a combo box displaying the current drive.  If this is possible how is it done?

Thanks Richard
LVL 1
Richard_EustaceAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
benzadonConnect With a Mentor Commented:
Yes, you can create in a dialog more than one list, each one will be associate with a name (you can do that using the classwizzard) and you can handle the message and methods for each list. But for your case, my recomendation is to split the dialog in two: a tree view and a list view, exactly the way Microsoft Exprores does.
0
 
BinderCommented:
 Yes, you have all this objects in one ready for use. It´s CFileDialog and it
encapsulates the Windows File Box (it appears in almost every
program that needs to display a directory).
0
 
Richard_EustaceAuthor Commented:
To binder

Is there no way to get the controls onto a normal dialog.  i am trying to create lists of C++ files which I am then analysing the complexity of, the CFileDialog method is too repeative as yoy have to open it for each file. I need to use other controls at the same time and flicking between the two dialogs is tricky.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Richard_EustaceAuthor Commented:
To benzadon

I want to add other controls to the dialog and if i use an explorer view I dont have room for other controls.
0
 
benzadonCommented:
If I understand well, what you want is to create a dialog with two views and a combo box as Microsoft explorer has, where in the left view you wanna show the directory structure and when the user clicks a folder to show it folder contents in the right view. If it is the case, again the best way is using a tree view for the directory structure and a list view for the folder content. When the user clicks a folder in the tree control, you gonna receive the event and fill the list view. How you receive the message?, when you creates the tree control in the resource editor of VC++, using the right button of the mouse over the tree control select ClassWizard, there choose the event you wanna handle. You can do the same with the list. The combo box can be filled in the same moment you fill the list. About the space, it is not a problem, because first the both controls have horizontal scolls and second they have tooltips too.
0
 
benzadonCommented:
I forgot to tell you that it is very important to assign a variable for each control (tree, list and combo box). How you do that?, select the control with the right botton, choose ClassWizard, open the "Member Variables" tab, double-click the id of the variable and in the Category fill be sure to select Control, now from your Dialog class you can use the control using this variable.
0
 
Richard_EustaceAuthor Commented:
to benzadon
How do you get the tree view to display the directorr structure?
0
All Courses

From novice to tech pro — start learning today.