Print Page | Close Window

how to get value of CXTPControlEdit

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=7439
Printed Date: 13 November 2025 at 2:02am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: how to get value of CXTPControlEdit
Posted By: xxcln
Subject: how to get value of CXTPControlEdit
Date Posted: 25 June 2007 at 2:08am

I create a edit in a toolbar,how to get value of the edit.




Replies:
Posted By: xxcln
Date Posted: 25 June 2007 at 6:59am

Let me describe detail:

//In OnCreateControl(LPCREATECONTROLSTRUCT lpCreateControl)
if (lpCreateControl->nID == ID_COUNTER_QUICKSEARCH)
 {
  CXTPControlEdit* pEdit = (CXTPControlEdit*) CXTPControlEdit::CreateObject();
  lpCreateControl->pControl = pEdit;
  return TRUE;
 }
 
//handle message
ON_XTP_EXECUTE(ID_COUNTER_QUICKSEARCH, OnCounterQuicksearch)
 
void CChildFrame::OnCounterQuicksearch(NMHDR* pNMHDR, LRESULT* pResult)
{
 // TODO: Add your command handler code here
 NMXTPCONTROL* tagNMCONTROL = (NMXTPCONTROL*)pNMHDR;
 CXTPControlComboBox* pEdit = (CXTPControlComboBox*)tagNMCONTROL->pControl;
 ASSERT(pEdit);
 ASSERT(pEdit->GetType() == xtpControlEdit);
 CString edit = ((CXTPControlEdit*)pEdit)->GetEditText();
 AfxMessageBox(edit);
}
add follow code then edit can't display in the toolbar


Posted By: xxcln
Date Posted: 25 June 2007 at 7:13am

edit display but unavailable



Posted By: xxcln
Date Posted: 25 June 2007 at 2:54pm
ON_XTP_EXECUTE not launch


Posted By: xxcln
Date Posted: 26 June 2007 at 12:44am

Does the message ON_XTP_EXECUTE can't handle in ChildFrame?



Posted By: Oleg
Date Posted: 26 June 2007 at 12:57am
Hello,
Yes, you can, Edit is disabled because you don't have update handler for it.
Add

 ON_UPDATE_COMMAND_UI(ID_COUNTER_QUICKSEARCH, OnUpdateQuickSearch)
void CChildFrame::OnUpdateQuickSearch(CCmdUI *pCmdUI)
{
 pCmdUI->Enable();
}


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: xxcln
Date Posted: 26 June 2007 at 3:09am
thank you, but ON_XTP_EXECUTE still not launch.whether the version's problem(my version 9.6),or when create toolbar in childframe need something else.


Posted By: Barto
Date Posted: 26 June 2007 at 4:11am
make sure to derive your frame from CXTPFrameWndBase<CMDIChildWnd>
and not from CMDIChildWnd, otherwise a lot of XTP messages don't get processed correctly


Posted By: xxcln
Date Posted: 26 June 2007 at 4:36am

my god ,solve eventually,thanks barto oleg




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net