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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

node click of treeview to open a list box below the treeview

Status
Not open for further replies.

wujen

Programmer
Aug 21, 2001
79
US
hey all,

This is what I have a treeview with static data as nodes.(since each node has a large amount of information with in it I can not add it all under one treeview--procedure too large). So I decide to use listboxes(indexed) to do this.

this is my code:--it does not work

prviate sub form_load()

dim i as integer
i = 0 to 83
lstData1(i).visible = false

end sub

Private Sub tvData1_NodeClick(ByVal Node As MSComctlLib.Node)

Select case node.key
case 1 ' a
if tvdata1.selecteditem.key = "a" then lstData1(0).visible= true
case 2 ' b
etc
etc
case 84 'aaaf
if tvdata1.selecteditem.key = "aaaf" then lstData1(83).visible = true
end select
end sub

Any clues what I am doing wrong?

Aaron
 
I think the problem is in the way you are addressing the node KEY
Select case tvdata1.selecteditem.key
case "a" :lstData1(0).visible= true
case "b" : lstData1(1).visible= true
etc
etc
case "aaaf":lstData1(83).visible= true

another suggestion I would make is rather then use 83 listboxes you consider changing the datasource or rowsource to the listbox instead

good luck
 
Braindead2,

thanks alot :D

aaron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top