<?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 : CXTEditListBox - editing an item</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : CXTEditListBox - editing an item]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 22 Apr 2026 05:04:20 +0000</pubDate>
  <lastBuildDate>Tue, 31 Mar 2009 22:20:19 +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=13848</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[CXTEditListBox - editing an item : hi Olegyou state that the end...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13848&amp;PID=47414&amp;title=cxteditlistbox-editing-an-item#47414</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5102">aksen</a><br /><strong>Subject:</strong> 13848<br /><strong>Posted:</strong> 31 March 2009 at 10:20pm<br /><br />hi Oleg<br><br>you state that the end label edit message is setting the selection and grabbing focus after EditItem() has been called. i already catch ON_LBN_XT_LABELEDITEND, and unless i'm doing something wrong, this message isn't being issued when i finish creating a <b>new</b> label, only when i finish editing an existing label. is this correct? would deriving my own class from CXTEditListBox change this behaviour?<br><br>thanks<br>andrew<br>]]>
   </description>
   <pubDate>Tue, 31 Mar 2009 22:20:19 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13848&amp;PID=47414&amp;title=cxteditlistbox-editing-an-item#47414</guid>
  </item> 
  <item>
   <title><![CDATA[CXTEditListBox - editing an item : Hello,  Indeed CXTEditListBox...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13848&amp;PID=47351&amp;title=cxteditlistbox-editing-an-item#47351</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 13848<br /><strong>Posted:</strong> 31 March 2009 at 2:19am<br /><br />Hello,<DIV>&nbsp;</DIV><DIV>Indeed CXTEditListBox in OnEndLabelEdit set selection and grab focus after it send message to parent - so your EditItem method will be canceled.</DIV><DIV></DIV><DIV></DIV><DIV>&nbsp;</DIV><DIV>Think to create better deign&nbsp;-&nbsp;create new class CUniqueEditListBox : CXTEditListBox</DIV><DIV>&nbsp;</DIV><DIV>add message map and catch </DIV><DIV>&nbsp;</DIV><DIV>ON_LBN_XT_LABELEDITCANCEL(XT_IDC_LBOX_EDIT, OnEndLabelEdit)<BR></DIV><DIV>in its OnEndLabelEdit handler first call base method and then check new item. - see original code of OnEndLabelEdit</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Tue, 31 Mar 2009 02:19:44 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13848&amp;PID=47351&amp;title=cxteditlistbox-editing-an-item#47351</guid>
  </item> 
  <item>
   <title><![CDATA[CXTEditListBox - editing an item : hi Oleghere are the relevant parts....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13848&amp;PID=47345&amp;title=cxteditlistbox-editing-an-item#47345</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5102">aksen</a><br /><strong>Subject:</strong> 13848<br /><strong>Posted:</strong> 30 March 2009 at 8:14pm<br /><br />hi Oleg<br><br>here are the relevant parts. if i leave the code as it is below, it doesn't do anything. if i change the code in OnListBoxNew() to post the UWM_EDIT_LIST_BOX_ITEM message instead of calling m_pEditListBoxControl-&gt;EditItem(m_nIndex), i get slightly different behaviour - it appears to briefly make the item in the list box editable, but then it immediately cancels that and goes back to normal selection mode.<br><br><font face="Courier New, Courier, mono">BEGIN_MESSAGE_MAP()<br>&nbsp; ON_LBN_XT_NEWITEM(IDC_LIST1, OnListBoxNew)<br>&nbsp; ON_MESSAGE(UWM_EDIT_LIST_BOX_ITEM, OnEditListBoxItem)<br>END_MESSAGE_MAP()<br><br>void CxyzDialog::OnListBoxNew()<br>&nbsp; {<br>&nbsp; int nCurrentSelection = m_pEditListBoxControl-&gt;GetCurrentIndex();<br>&nbsp; if (nCurrentSelection != -1)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; CString sCurrentSelection;<br>&nbsp;&nbsp;&nbsp; m_pEditListBoxControl-&gt;GetText(nCurrentSelection, sCurrentSelection);<br>&nbsp;&nbsp;&nbsp; if (!Exists(sCurrentSelection))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SetName(sCurrentSelection);<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_nIndex = nCurrentSelection;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_pEditListBoxControl-&gt;EditItem(m_nIndex);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //PostMessage(UWM_EDIT_LIST_BOX_ITEM);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp; }<br><br>long CxyzDialog::OnEditListBoxItem(UINT wParam, long lParam)<br>&nbsp; {<br>&nbsp; m_pEditListBoxControl-&gt;EditItem(m_nIndex);<br>&nbsp; return 0l;<br>&nbsp; }</font><br><br>thanks<br>andrew<br>]]>
   </description>
   <pubDate>Mon, 30 Mar 2009 20:14:14 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13848&amp;PID=47345&amp;title=cxteditlistbox-editing-an-item#47345</guid>
  </item> 
  <item>
   <title><![CDATA[CXTEditListBox - editing an item : Hi,  ok, what code you have...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13848&amp;PID=47320&amp;title=cxteditlistbox-editing-an-item#47320</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 13848<br /><strong>Posted:</strong> 30 March 2009 at 12:35pm<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>ok, what code you have now ? I need to check it.</DIV>]]>
   </description>
   <pubDate>Mon, 30 Mar 2009 12:35:10 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13848&amp;PID=47320&amp;title=cxteditlistbox-editing-an-item#47320</guid>
  </item> 
  <item>
   <title><![CDATA[CXTEditListBox - editing an item : hi Olegi already catch both of...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13848&amp;PID=47307&amp;title=cxteditlistbox-editing-an-item#47307</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5102">aksen</a><br /><strong>Subject:</strong> 13848<br /><strong>Posted:</strong> 30 March 2009 at 5:25am<br /><br />hi Oleg<br><br>i already catch both of those - its where i currently do my checking. i've already done the renaming idea, but i don't really like it as a solution to the problem. is making an item editable in the list box just not possible? is EditItem() not meant to work like that?<br><br>andrew<br>]]>
   </description>
   <pubDate>Mon, 30 Mar 2009 05:25:36 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13848&amp;PID=47307&amp;title=cxteditlistbox-editing-an-item#47307</guid>
  </item> 
  <item>
   <title><![CDATA[CXTEditListBox - editing an item : Hi,  You can catch LBN_XT_NEWITEM...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13848&amp;PID=47305&amp;title=cxteditlistbox-editing-an-item#47305</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 13848<br /><strong>Posted:</strong> 30 March 2009 at 5:04am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>You can catch LBN_XT_NEWITEM and LBN_XT_LABELEDITEND, check item text - if dublicate - rename it to some "itemname1"</DIV>]]>
   </description>
   <pubDate>Mon, 30 Mar 2009 05:04:13 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13848&amp;PID=47305&amp;title=cxteditlistbox-editing-an-item#47305</guid>
  </item> 
  <item>
   <title><![CDATA[CXTEditListBox - editing an item : hi therei&amp;#039;m using a CXTEditListBox...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13848&amp;PID=47298&amp;title=cxteditlistbox-editing-an-item#47298</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5102">aksen</a><br /><strong>Subject:</strong> 13848<br /><strong>Posted:</strong> 30 March 2009 at 3:13am<br /><br />hi there<br><br>i'm using a CXTEditListBox to contain a list of objects that the user creates and can edit. the objects are uniquely identified by a name, and so i need the list box to enforce uniqueness. the way i would like it to work is that once they create a new entry in the list box, i will do validation to make sure the name is unique. if it isn't, i'd like the item in the list box to remain in edit mode, but i cannot seem to get this to happen.<br><br>i did a search of the forum, and found a thread where someone wanted this same behaviour (see <a href="http://forum.codejock.com/forum_posts.asp?TID=5414&amp;KW=CXTEditListBox" target="_blank">http://forum.codejock.com/forum_posts.asp?TID=5414</a>). their solution was to post a user message back to the dialog, and call CXTEditListBox::EditItem() in the user message handler, as calling EditItem() in the list box handler did not work. i've tried this solution, and it still doesn't work - it appears to briefly make the item editable, before ending edit mode.<br><br>how can i get this to work? i want the name validation to be done before the items are committed to the list box, as having duplicates in the list box creates confusion for the user (and for the programmer as well).<br><br>thanks<br>andrew<br>]]>
   </description>
   <pubDate>Mon, 30 Mar 2009 03:13:28 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13848&amp;PID=47298&amp;title=cxteditlistbox-editing-an-item#47298</guid>
  </item> 
 </channel>
</rss>