5

I have been given the task of converting a forms application to WPF. The application used TreeNode which is from System.Windows.Forms.TreeView. I know WPF has TreeView but I can't find TreeNode is there a direct conversion for it from Forms to WPF?

2 Answers 2

19

TreeNode has been replaced with TreeViewItem.

TreeNode.Text is equivalent to TreeViewItem.Header

TreeNode.Nodes is equivalent to TreeViewItem.Items

2
  • 2
    I hope you could upvote this so I can give answers again. Thanks.
    – Haapavuo
    Jan 23, 2015 at 12:34
  • This is awsome!
    – IceCode
    Sep 7, 2018 at 10:08
15

It is TreeViewItem.

1
  • I would like to add that this is the best conversion we have but, the functionality is not exact. Or I should say the way you go about doing things isn't the same but has more or less the same outcome.
    – Krill
    Feb 3, 2010 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.