vb.net treeview prevnode problems

F

Felix

Hi,
I'm having difficulty with the treeview control in vb.net.

The following is my code:

Dim somenode As TreeNode
somenode = treeCheck.SelectedNode
treeCheck.SelectedNode = somenode.prevnode

Basically i just want the node before the selected node to be selected but
for some reason VB.net isn't recognizing Prevnode as a property in the
TreeNode Class. Even though the docs say it is.
"PrevNode - TreeNode - Read-only. The previous sibling node in the parent
node's Nodes collection. If there is no previous node, returns
null/Nothing."

somenode is a TreeNode so it should have PrevNode, but it doesn't. Anyone
have any ideas?

Thank you,
Felix
 
A

Armin Zingler

Felix said:
Hi,
I'm having difficulty with the treeview control in vb.net.

The following is my code:

Dim somenode As TreeNode
somenode = treeCheck.SelectedNode
treeCheck.SelectedNode = somenode.prevnode

Basically i just want the node before the selected node to be
selected but for some reason VB.net isn't recognizing Prevnode as a
property in the TreeNode Class. Even though the docs say it is.
"PrevNode - TreeNode - Read-only. The previous sibling node in the
parent node's Nodes collection. If there is no previous node,
returns null/Nothing."

somenode is a TreeNode so it should have PrevNode, but it doesn't.
Anyone have any ideas?

This code compiles fine here. VB.Net 2003, Framework 1.1.


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
F

Felix

I also have Vb.net 2003 1.1 Framework.

I've tried just having this code fragement alone in a Visual Studio Project
of its own and it still says: prevnode is not a member of
System.Windows.Forms.TreeNode.

Anyone have any clue what i'm doing wrong?
Thanks,
Felix
 
F

Felix

I forgot to mention i'm coding with the .net compact framework.

I guess the .net CF doesn't have those properties for a treenode :-(

Felix
 
F

Felix

Yea i just checked MSDN and prevnode and many others aren't supported in the
..net CF!

Now i need to completly rethink the entire design of my code. Perfect.

Thanks for the help.
Felix
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top