{"id":1286,"date":"2015-01-13T14:50:13","date_gmt":"2015-01-13T14:50:13","guid":{"rendered":"https:\/\/ibex.tech\/visualcpp\/?p=1286"},"modified":"2022-02-17T06:24:03","modified_gmt":"2022-02-17T06:24:03","slug":"tree-view-general","status":"publish","type":"post","link":"https:\/\/ibex.tech\/visualcpp\/tree-view\/tree-view-general","title":{"rendered":".Tree View General"},"content":{"rendered":"<h4>\nClear Tree View<br \/>\n<\/h4>\n<pre>\r\n<code>\r\n\ttvSelectProbe-&gt;Nodes-&gt;Clear();\r\n<\/code>\r\n<\/pre>\n<h4>\nAdd A Node<br \/>\n<\/h4>\n<pre>\r\n<code>\r\n\ttvSelectProbe-&gt;Nodes-&gt;Add(&quot;Some Text&quot;);\r\n<\/code><\/pre>\n<h4>\nAdd Sub Nodes<br \/>\n<\/h4>\n<p>\nThe Tree View is made up of TreeNodes which themselves can be made up of TreeNodes&#8230;\n<\/p>\n<pre>\r\n<code>\r\n\tthis-&gt;SuspendLayout();\r\n\r\n\t\/\/Create first sub node\r\n\tTreeNode ^TreeNode2 = gcnew TreeNode(&quot;Tree Node 2&quot;);\r\n\tTreeNode2-&gt;Nodes-&gt;Add(&quot;Sub 2&quot;);\r\n\r\n\t\/\/Create second sub node\r\n\tTreeNode ^TreeNode3 = gcnew TreeNode(&quot;Tree Node 3&quot;);\r\n\tTreeNode3-&gt;Nodes-&gt;Add(&quot;Sub 3A&quot;);\r\n\tTreeNode3-&gt;Nodes-&gt;Add(&quot;Sub 3B&quot;);\r\n\r\n\t\/\/Combine them into a master node\r\n\tarray&lt;TreeNode^&gt; ^TreeNodeArray1 = { TreeNode2, TreeNode3 };\r\n\tTreeNode ^TreeNode4 = gcnew TreeNode(&quot;Tree Node Array 1&quot;, TreeNodeArray1);\r\n\r\n\t\/\/Add this to the tree view\r\n\ttvSelectProbe-&gt;Nodes-&gt;Add(TreeNode4);\r\n\r\n\tthis-&gt;ResumeLayout();\r\n<\/code><\/pre>\n<h4>\nDeSelect&nbsp;Selected Node<br \/>\n<\/h4>\n<pre>\r\n<code>\r\n\ttvSelectProbe-&gt;SelectedNode = nullptr;\r\n<\/code><\/pre>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Clear Tree View tvSelectProbe-&gt;Nodes-&gt;Clear(); Add A Node tvSelectProbe-&gt;Nodes-&gt;Add(&quot;Some Text&quot;); Add Sub Nodes The Tree View is made up of TreeNodes which themselves can be made up of TreeNodes&#8230; this-&gt;SuspendLayout(); \/\/Create first sub node TreeNode ^TreeNode2 = gcnew TreeNode(&quot;Tree Node 2&quot;); TreeNode2-&gt;Nodes-&gt;Add(&quot;Sub 2&quot;); \/\/Create second sub node TreeNode ^TreeNode3 = gcnew TreeNode(&quot;Tree Node 3&quot;); TreeNode3-&gt;Nodes-&gt;Add(&quot;Sub 3A&quot;); [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[112],"tags":[],"class_list":["post-1286","post","type-post","status-publish","format-standard","hentry","category-tree-view"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/1286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/comments?post=1286"}],"version-history":[{"count":4,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/1286\/revisions"}],"predecessor-version":[{"id":1304,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/1286\/revisions\/1304"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/media?parent=1286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/categories?post=1286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/tags?post=1286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}