Can't use EditItem method of CXTEditListBox class
Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=5414
Printed Date: 27 September 2024 at 9:30am Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: Can't use EditItem method of CXTEditListBox class
Posted By: Michaelw
Subject: Can't use EditItem method of CXTEditListBox class
Date Posted: 02 November 2006 at 3:21pm
I am using CXTEditListBox to edit a list of items. There is a need to prevent duplicate entry in the list. So I maped the ON_LBN_XT_LABELEDITEND message. Inside the message handle function, I check the text of current edit item. If the same item already exist. I try to force the user to edit the current item again. I use void CXTEditListBox.EditItem(int iItem) to edit the item. However, the item selected doesn't entry a edit state. I tried to put EnableEdit() in front of it . Still not working. Does anyone know how to solve this problem?
Thanks,
ON_LBN_XT_LABELEDITEND(IDC_LIST_FRAMEWORK, OnLabelEditEnd)
void CMyDlg::OnLabelEditEnd() { int nSel = m_lstFramework.GetCurrentIndex(); if( nSel == LB_ERR ) return; CString strText; m_lstFramework.GetText(nSel, strText); strText.Trim(); if( IsNameDuplicated(strText, nSel) ) { //show a message. ... //this doesn't work. m_lstFramework.EditItem(nSel); } }
|
Replies:
Posted By: Michaelw
Date Posted: 09 November 2006 at 3:33pm
I figure out the problem is caused by calling EditItem() function inside a list box message handler. If I call it from other place, it works. So I post a user message to the dialog that host this control. Inside the user message handler. I call the EditItem() function. Problem solved.
|
|