4 Replies - 591 Views - Last Post: 16 January 2012 - 03:44 PM Rate Topic: -----

#1 basketball_22002  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 15-January 12

C++ Folder View in Visual Basic Forms Application

Posted 15 January 2012 - 05:38 PM

Hello, pretty green when it comes to C++ im more familiar with AS3 but I'm looking to start making windows programs, anyways I was looking for a way to display a directory within my program like depicted in this video. http://www.youtube.c...h?v=Yit9n2CMmhQ I want to be able to view all the files under a certain path like say my documents, Im curious if the TreeView would be the correct tool to use in this situation, and if so how would I go about linking it to a directory, and possibly if i were to share the program with my friends, how would it know to change certain aspects of the directory like if its C:\Users\Richard\Documents for me, could I get it to automatically change the "Richard" to whatever the name of their computer is? I've looked around on msdn reading up on the various tools I thought might be good to drag and drop onto my program to look, Directory Entry/Search dont make a box to actually view the folder on the application, and im just not sure at all how to go about solving this. Any help would be greatyly appreciated, thanks for the read.

Is This A Good Question/Topic? 0
  • +

Replies To: C++ Folder View in Visual Basic Forms Application

#2 #define  Icon User is offline

  • Duke of Err
  • member icon

Reputation: 1276
  • View blog
  • Posts: 4,400
  • Joined: 19-February 09

Re: C++ Folder View in Visual Basic Forms Application

Posted 15 January 2012 - 07:42 PM

Are you using the Visual Studio Form designer?

You can get User information from environment variables.
Was This Post Helpful? 0
  • +
  • -

#3 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 856
  • View blog
  • Posts: 2,246
  • Joined: 28-March 11

Re: C++ Folder View in Visual Basic Forms Application

Posted 15 January 2012 - 07:52 PM

Why re-invent the wheel? I am sure C++ has a wrapper for the API SHBrowseForFolder.
Was This Post Helpful? 0
  • +
  • -

#4 basketball_22002  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 15-January 12

Re: C++ Folder View in Visual Basic Forms Application

Posted 16 January 2012 - 01:16 PM

Ok so I have a folderBrowswerDialog, but how would I display it in a listview component, like for a textbox, I was doing

textBox1->Text = folderBrowserDialog1->SelectedPath; but I dont want to view the path text, I want to view the contents of a folder, also kinda curious how I would specificy a path, would i put it in quotes like "C:\"?
Was This Post Helpful? 0
  • +
  • -

#5 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 856
  • View blog
  • Posts: 2,246
  • Joined: 28-March 11

Re: C++ Folder View in Visual Basic Forms Application

Posted 16 January 2012 - 03:44 PM

You don't. the whole "Control" is written for you by Microsft. I don't know what folderBrowswerDialog is, but if it is a wrapper for SHBrowseForFolder then you call it, it opens the same dialog the guy in the video has and allows you to select from a folder on your drive.

If you just want to select a file or view whats in a folder use whatever wrapper C++ has for the Open/Save Common Dialog the API for that is GetOpenFileName
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1