<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : How to deselect items in tree control</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Controls : How to deselect items in tree control]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 04:22:25 +0000</pubDate>
  <lastBuildDate>Thu, 30 Jan 2014 11:39:43 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=22185</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[How to deselect items in tree control : Hi, I&amp;#039;ve seen that I can...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22185&amp;PID=72221&amp;title=how-to-deselect-items-in-tree-control#72221</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=8640">Norbini</a><br /><strong>Subject:</strong> 22185<br /><strong>Posted:</strong> 30 January 2014 at 11:39am<br /><br />Hi,<div><br></div><div>&nbsp; I've seen that I can select items in a multi-select tree control using SelectItem() or SelectItems(), but what is the correct way to deselect items?</div><div><br></div><div>&nbsp; I guess it is possible to do (in pseudocode):</div><div><span style="line-height: 1.4;"><table width="99%"><tr><td><pre class="BBcode"></span></div><div>&nbsp; &nbsp; CTypedPtrList&lt;CPtrList, HTREEITEM&gt; CurrentSelection;</div><div>&nbsp; &nbsp; GetSelectedItems(CurrentSelection); &nbsp; // Get the list of currently selected items</div><div>&nbsp; &nbsp; SelectAll(FALSE, NULL); // Deselect all items</div><div>&nbsp; &nbsp; for (PreviouslySelectedItem in CurrentSelection) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if (PreviouslySelectedItem != ItemToDeselect) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SelectItem(PreviouslySelectedItem); // Select all previously selected items except the item to deselect</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div></pre></td></tr></table></div><div><br></div><div>&nbsp; However, I suspect this will generate a large number of TVN_SELCHANGED messages and probably make the selection flicker.</div><div><br></div><div>&nbsp; Is there a better way that I'm missing or would this approach be ok?</div><div><br></div><div>&nbsp; Many thanks in advance,</div><div>&nbsp; &nbsp; -Nige</div>]]>
   </description>
   <pubDate>Thu, 30 Jan 2014 11:39:43 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22185&amp;PID=72221&amp;title=how-to-deselect-items-in-tree-control#72221</guid>
  </item> 
 </channel>
</rss>