{"id":7327,"date":"2015-04-07T20:20:52","date_gmt":"2015-04-07T11:20:52","guid":{"rendered":"http:\/\/www.webshare.co.kr\/?p=7327"},"modified":"2015-04-07T20:20:52","modified_gmt":"2015-04-07T11:20:52","slug":"ccpp-mfc-%ed%8a%b8%eb%a6%ac%ec%bb%a8%ed%8a%b8%eb%a1%a4-expand-collapse","status":"publish","type":"post","link":"https:\/\/www.webshare.co.kr\/?p=7327","title":{"rendered":"[C\/CPP] MFC \ud2b8\ub9ac\ucee8\ud2b8\ub864, Expand \/ Collapse"},"content":{"rendered":"<p><span style=\"font-size: 14pt;\"><strong>MFC Tree Control: How to expand\/collapse a branch?<\/strong><\/span><br \/><span style=\"font-size: 12pt;\">Q: How to expand\/collapse a branch?<\/span><br \/><span style=\"font-size: 12pt;\">A: If you want to expand or collapse one only item use<\/span><br \/><span style=\"font-size: 12pt;\">Code:<\/span><\/p>\n<pre class=\"lang:c++ decode:true \">m_tree.Expand(hItem, TVE_EXPAND); \/\/ or 'TVE_COLLAPSE'<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: 12pt;\">If you want to expand or collapse an item and all of its children use something like this:<\/span><br \/><span style=\"font-size: 12pt;\">Code:<\/span><\/p>\n<pre class=\"lang:c++ decode:true \">void ExpandTreeItem(const CTreeCtrl &amp;tree, HTREEITEM hItem, UINT nCode)\r\n{\r\n    HTREEITEM hChild;\r\n\r\n    if(tree.ItemHasChildren(hItem))\r\n    {\r\n        tree.Expand(hItem, nCode);\r\n        hChild = tree.GetChildItem(hItem);\r\n\r\n        while(hChild)\r\n        {\r\n            ExpandTreeItem(tree, hChild, nCode);\r\n            hChild = tree.GetNextItem(hChild, TVGN_NEXT);\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: 12pt;\">Last edited by Andreas Masur; July 25th, 2005 at 04:57 PM.<\/span><br \/><span style=\"font-size: 12pt;\">\ucd9c\ucc98 &#8211; <a href=\"http:\/\/forums.codeguru.com\/showthread.php?231228-MFC-Tree-Control-How-to-expand-collapse-a-branch\">http:\/\/forums.codeguru.com\/showthread.php?231228-MFC-Tree-Control-How-to-expand-collapse-a-branch<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>MFC Tree Control: How to expand\/collapse a branch?Q: How to expand\/collapse a branch?A: If you want to expand or collapse one only item useCode: m_tree.Expand(hItem, TVE_EXPAND); \/\/ or &#8216;TVE_COLLAPSE&#8217; &nbsp; If you want to expand or collapse an item and all of its children use something like this:Code: void ExpandTreeItem(const CTreeCtrl &amp;tree, HTREEITEM hItem, UINT [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[54],"tags":[],"class_list":["post-7327","post","type-post","status-publish","format-standard","hentry","category-cc"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[C\/CPP] MFC \ud2b8\ub9ac\ucee8\ud2b8\ub864, Expand \/ Collapse - WEBSHARE<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webshare.co.kr\/?p=7327\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[C\/CPP] MFC \ud2b8\ub9ac\ucee8\ud2b8\ub864, Expand \/ Collapse - WEBSHARE\" \/>\n<meta property=\"og:description\" content=\"MFC Tree Control: How to expand\/collapse a branch?Q: How to expand\/collapse a branch?A: If you want to expand or collapse one only item useCode: m_tree.Expand(hItem, TVE_EXPAND); \/\/ or &#039;TVE_COLLAPSE&#039; &nbsp; If you want to expand or collapse an item and all of its children use something like this:Code: void ExpandTreeItem(const CTreeCtrl &amp;tree, HTREEITEM hItem, UINT [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webshare.co.kr\/?p=7327\" \/>\n<meta property=\"og:site_name\" content=\"WEBSHARE\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/at.in.story\" \/>\n<meta property=\"article:published_time\" content=\"2015-04-07T11:20:52+00:00\" \/>\n<meta name=\"author\" content=\"\uae40\uc8fc\ud658\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@kasthe88\" \/>\n<meta name=\"twitter:site\" content=\"@kasthe88\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"\uae40\uc8fc\ud658\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webshare.co.kr\/?p=7327\",\"url\":\"https:\/\/www.webshare.co.kr\/?p=7327\",\"name\":\"[C\/CPP] MFC \ud2b8\ub9ac\ucee8\ud2b8\ub864, Expand \/ Collapse - WEBSHARE\",\"isPartOf\":{\"@id\":\"https:\/\/www.webshare.co.kr\/#website\"},\"datePublished\":\"2015-04-07T11:20:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.webshare.co.kr\/#\/schema\/person\/9e983879292f0da0f456d086e9711751\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.webshare.co.kr\/?p=7327#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webshare.co.kr\/?p=7327\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webshare.co.kr\/?p=7327#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webshare.co.kr\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[C\/CPP] MFC \ud2b8\ub9ac\ucee8\ud2b8\ub864, Expand \/ Collapse\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webshare.co.kr\/#website\",\"url\":\"https:\/\/www.webshare.co.kr\/\",\"name\":\"WEBSHARE\",\"description\":\"\ucda4\ucd94\ub294 \ud504\ub85c\uadf8\ub798\uba38\uc758 \ube14\ub85c\uadf8\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webshare.co.kr\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webshare.co.kr\/#\/schema\/person\/9e983879292f0da0f456d086e9711751\",\"name\":\"\uae40\uc8fc\ud658\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.webshare.co.kr\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d41231d1bc4cf3b9d09da2a1cb107802e2a82fc6f80bf0668f70c3dd963e9699?s=96&d=mm&r=pg\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d41231d1bc4cf3b9d09da2a1cb107802e2a82fc6f80bf0668f70c3dd963e9699?s=96&d=mm&r=pg\",\"caption\":\"\uae40\uc8fc\ud658\"},\"sameAs\":[\"http:\/\/www.atfolio.co.kr\"],\"url\":\"https:\/\/www.webshare.co.kr\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[C\/CPP] MFC \ud2b8\ub9ac\ucee8\ud2b8\ub864, Expand \/ Collapse - WEBSHARE","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webshare.co.kr\/?p=7327","og_locale":"ko_KR","og_type":"article","og_title":"[C\/CPP] MFC \ud2b8\ub9ac\ucee8\ud2b8\ub864, Expand \/ Collapse - WEBSHARE","og_description":"MFC Tree Control: How to expand\/collapse a branch?Q: How to expand\/collapse a branch?A: If you want to expand or collapse one only item useCode: m_tree.Expand(hItem, TVE_EXPAND); \/\/ or 'TVE_COLLAPSE' &nbsp; If you want to expand or collapse an item and all of its children use something like this:Code: void ExpandTreeItem(const CTreeCtrl &amp;tree, HTREEITEM hItem, UINT [&hellip;]","og_url":"https:\/\/www.webshare.co.kr\/?p=7327","og_site_name":"WEBSHARE","article_publisher":"https:\/\/www.facebook.com\/at.in.story","article_published_time":"2015-04-07T11:20:52+00:00","author":"\uae40\uc8fc\ud658","twitter_card":"summary_large_image","twitter_creator":"@kasthe88","twitter_site":"@kasthe88","twitter_misc":{"\uae00\uc4f4\uc774":"\uae40\uc8fc\ud658","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"1\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.webshare.co.kr\/?p=7327","url":"https:\/\/www.webshare.co.kr\/?p=7327","name":"[C\/CPP] MFC \ud2b8\ub9ac\ucee8\ud2b8\ub864, Expand \/ Collapse - WEBSHARE","isPartOf":{"@id":"https:\/\/www.webshare.co.kr\/#website"},"datePublished":"2015-04-07T11:20:52+00:00","author":{"@id":"https:\/\/www.webshare.co.kr\/#\/schema\/person\/9e983879292f0da0f456d086e9711751"},"breadcrumb":{"@id":"https:\/\/www.webshare.co.kr\/?p=7327#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webshare.co.kr\/?p=7327"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.webshare.co.kr\/?p=7327#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webshare.co.kr\/"},{"@type":"ListItem","position":2,"name":"[C\/CPP] MFC \ud2b8\ub9ac\ucee8\ud2b8\ub864, Expand \/ Collapse"}]},{"@type":"WebSite","@id":"https:\/\/www.webshare.co.kr\/#website","url":"https:\/\/www.webshare.co.kr\/","name":"WEBSHARE","description":"\ucda4\ucd94\ub294 \ud504\ub85c\uadf8\ub798\uba38\uc758 \ube14\ub85c\uadf8","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webshare.co.kr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Person","@id":"https:\/\/www.webshare.co.kr\/#\/schema\/person\/9e983879292f0da0f456d086e9711751","name":"\uae40\uc8fc\ud658","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.webshare.co.kr\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d41231d1bc4cf3b9d09da2a1cb107802e2a82fc6f80bf0668f70c3dd963e9699?s=96&d=mm&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d41231d1bc4cf3b9d09da2a1cb107802e2a82fc6f80bf0668f70c3dd963e9699?s=96&d=mm&r=pg","caption":"\uae40\uc8fc\ud658"},"sameAs":["http:\/\/www.atfolio.co.kr"],"url":"https:\/\/www.webshare.co.kr\/?author=1"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5iVrd-1Ub","_links":{"self":[{"href":"https:\/\/www.webshare.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/7327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webshare.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webshare.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webshare.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webshare.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7327"}],"version-history":[{"count":1,"href":"https:\/\/www.webshare.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/7327\/revisions"}],"predecessor-version":[{"id":7328,"href":"https:\/\/www.webshare.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/7327\/revisions\/7328"}],"wp:attachment":[{"href":"https:\/\/www.webshare.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webshare.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webshare.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}