Treeview Selected Node
-
I have treeview and 2 listview on my form.And there is one menu with text multiple windows.If the multiplewindows menu is checked and 2nd listview.items.count > 1 then I am using the following lines to open a new window of the same form. Dim newform as new frmscore newform.show Now I want to select the same treeview node on the new form which is selected on the form frmscore.And the same item should be selected on the new form which is selected on the form frmscore(First Window). How I can solve this? Thanks In Advance. Ejaz
-
I have treeview and 2 listview on my form.And there is one menu with text multiple windows.If the multiplewindows menu is checked and 2nd listview.items.count > 1 then I am using the following lines to open a new window of the same form. Dim newform as new frmscore newform.show Now I want to select the same treeview node on the new form which is selected on the form frmscore.And the same item should be selected on the new form which is selected on the form frmscore(First Window). How I can solve this? Thanks In Advance. Ejaz
Expose a public method on your second form (frmscore) that finds and selects the item you pass in from the original form.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Expose a public method on your second form (frmscore) that finds and selects the item you pass in from the original form.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007Thanks Dave for ur reply. I tried to store the fullpath value of the original form in the variable and then expand the nodes of treeview on the new form and try to find the node with the same path but it is not working.How I can use the full path in loop to check all the nodes of the new form with the same path and if found then select that node. Any Idea how to solve this. Ejaz
-
Thanks Dave for ur reply. I tried to store the fullpath value of the original form in the variable and then expand the nodes of treeview on the new form and try to find the node with the same path but it is not working.How I can use the full path in loop to check all the nodes of the new form with the same path and if found then select that node. Any Idea how to solve this. Ejaz
Get the parent of the selected node and add it to a list. Get the parent of that node, add it to the list. Get the parent of that node, add it to the list... Until there are no more parents. You pass this list to the other form. Now, in reverse order, you can build and open the path to the node you're looking for.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Get the parent of the selected node and add it to a list. Get the parent of that node, add it to the list. Get the parent of that node, add it to the list... Until there are no more parents. You pass this list to the other form. Now, in reverse order, you can build and open the path to the node you're looking for.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007hi Can Anyone tell me what functions can help in doing this or how can this be achieved using code .. thanks ...
Rama Charan Prasad "Be happy and Keep smiling.Thats what u want be always..:)"
modified on Monday, December 17, 2007 11:07:29 AM