Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Pro Visual Basic 2005
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Pro Visual Basic 2005 For advanced Visual Basic coders working in version 2005. Beginning-level questions will be redirected to other forums, including Beginning VB 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro Visual Basic 2005 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 20th, 2007, 03:44 PM
Authorized User
Join Date: Dec 2006
Location: Fort Collins, Colorado, USA.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to maxl
Default Expanding TreeView from double clicking ListView

I know a lot of people have asked about this and hopefully im not being redundant. I've got an app that displays encrypted files on a USB drive in a treeview/listview combo and im trying to program functionality to double click a folder in listview and have the treevew auto expand and/or highlight the node the corresponds to the folder that was double clicked. The code is activated by a ListViewItemActivate event handler and then its supposed to call the NodeMouseClick event handler for the TreeView when i need it to load the contents of that folder into the ListView and expand the Treeview as far as that particular Node. I've gotten as far as loading the contents of the folder into the listview, thats it. it only does it for one level, meaning if i try and open another folder within the folder i just opened it will just sit. The treeview control doesn't do anything. Any info on this would be great. I know i could use some sord of combination of directoryinfo's with treenodes and things, but i already have this subroutine and i would like to keep the code tidy. Let me know if you would like the code posted.

Any suggestions?

Thanks in advance!

  #2 (permalink)  
Old March 5th, 2007, 12:54 PM
Authorized User
Join Date: Oct 2004
Location: Nottingham, , United Kingdom.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to VBM2

Hi maxl,

One very quick idea...

Both those controls allow you to add "keys" to each individual item /node within the control. So for example:

lstView.Items.Add(mykey, mydisplayvalue, 0)

and then for the treeview:

tvwTree.Nodes.Add(mykey, mydisplayvalue)

Upon the listview item click if there is one?? I can't remember.. you could just then say :


Only problem is that you (obviously) need something that's unique... like an ID number to go into these "keys".

Hope this helps!



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
CMS: Expanding the database retroviz BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 12 February 27th, 2007 06:15 PM
Compressing and expanding files within an app alantodd Pro VB Databases 1 May 8th, 2006 04:12 PM
Expanding menu blaabil Javascript How-To 0 May 26th, 2005 12:21 PM
aspx - dynamically expanding the page vhrao General .NET 1 November 5th, 2004 03:49 PM
Dynamically expanding and collapsing elements richard.york Javascript 3 November 26th, 2003 09:17 PM

All times are GMT -4. The time now is 01:13 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.