|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Treeview - relative positionforgive me, but I'm fairly new to VB.Net - having only used VB6 in the
past - - I can easily place a node on the treeview (tv1.nodes.add(key, text) BUT - in VB6, we'd add a child node (TV1.NOdes.add...), and in that string, we'd pick the parent/relative node, so that it would be placed under the correct node.... How is that accomplished now? Elmo Watson wrote:
> I can easily place a node on the treeview (tv1.nodes.add(key, text) In much the same way.> BUT - > in VB6, we'd add a child node (TV1.NOdes.add...), and in that string, we'd > pick the parent/relative node, so that it would be placed under the correct > node.... > > How is that accomplished now? Every TreeNode has a Nodes collection to which you can add [child] TreeNodes. Annoyingly, in VB'2003, anyway, the Add method seems to return an Index, not a TreeNode proper, so you have to muck about a /bit/, as in Dim oRootNode as TreeNode _ = tv1.Nodes.Add( "Root" ) Dim iIndex as Integer _ = oRootNode.Nodes.Add( "Child 1" ) Dim oChild1 as TreeNode _ = tv1.Nodes( iIndex ) iIndex = oChild1.Nodes.Add( "Grandchild 1" ) Dim oGrandChild As TreeNode _ = oChild1.Nodes( iIndex ) All of which is fine when initially loading the tree, but finding an item that you've already loaded is a pain, since the TreeView doesn't have keyed Nodes any more. But it's easy enough to implement your own. HTH, Phill W.
Query based on user input
C# help!!! LsaOpenPolicy : Attempted to read or write protected memory Challenge? [De-]Serialise a class derived from DataTable. DataGridView Edit row marker Getting XML Version difference between MyBase.Closing and MyBase.FormClosing Memory by user Sorting a datagrigview Getting an application to be on top of other applications |
|||||||||||||||||||||||