Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Folder like view Expandable in vb .Net

Status
Not open for further replies.

Shift838

IS-IT--Management
Jan 27, 2003
987
0
0
US
I need to make some type of folder like view that is expandable within a program. So it will store it in flat text file and populate it when the form loads.

I need it to be like a folder to put computer names in. So something like to create Web Servers then be able to add and display the web servers under that heading. to be able to expand each heading to see the server names.

I have no idea how to do that. I have scowered the net for days and have not found anything.
Any help would be appreciated..
 
You would use the TreeView control for this.

Here's a link to a simple tutorial to get you started:


If/when you have any questions, don't hesitate to ask.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Thanks. that is what i was thinking. i have to think of a way to save it to a file some how so it imports it when the form loads. that way it gets the nodes (folders) and the child objects.

Do know of a way to be able to do that effectively?
 
XML would probably work pretty well. Here's a link:



I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
jebensen,

When I add the code from the support artile I get the below error when trying to run the code:

Error 2 Overload resolution failed because no accessible 'Item' can be called without a narrowing conversion:
'Public Overridable ReadOnly Default Property Item(key As String) As System.Windows.Forms.TreeNode': Argument matching parameter 'key' narrows from 'Long' to 'String'.
'Public Overridable Default Property Item(index As Integer) As System.Windows.Forms.TreeNode': Argument matching parameter 'index' narrows from 'Long' to 'Integer'. H:\VS Projects\MultiRemoteDesktop\MultiRemoteDesktop\Form1.vb 105 25 MultiRemoteDesktop

The peice of code that is geneerating the error is in the Private Sub Add Node area:

Code:
tNode = inTreeNode.Nodes(i)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top