none
Cannot create TreeViewItem

    Question

  • I cannot determine how to get access to the TreeViewItem object. I have imported the System.object reference, but when I attempt to build my solution, I get the following: Type 'TreeViewItem' is not defined.

    My dev environment is VS Ultimate 2012. VB 2012 Windows App program.

    Any advise appreciated!

    Thursday, October 17, 2013 8:47 PM

Answers

  • Hi,

    there is System.Windows.Controls.TreeViewItem, so it's part of a WPF application. For Windows forms application the type is System.Windows.Forms.TreeNode.



    Armin

    • Marked as answer by scttech1967 Friday, October 25, 2013 3:45 PM
    Thursday, October 17, 2013 8:53 PM

All replies

  • Hi,

    there is System.Windows.Controls.TreeViewItem, so it's part of a WPF application. For Windows forms application the type is System.Windows.Forms.TreeNode.



    Armin

    • Marked as answer by scttech1967 Friday, October 25, 2013 3:45 PM
    Thursday, October 17, 2013 8:53 PM
  • Correction: the import was for System.Windows.Controls namespace (not System.object as noted). My error with this import is: Namespace or type specified in the Imports 'System.Windows.Controls' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
    Thursday, October 17, 2013 8:57 PM
  • What sort of project is this? There should be no need for an import in a standard Windows Forms project for the treeview component to be accessible. Does the Treeview appear in the toolbox in Designer view?
    Thursday, October 17, 2013 10:23 PM