![]() |
how to get value of CXTPControlEdit |
Post Reply
|
| Author | |
xxcln
Newbie
Joined: 05 June 2007 Location: China Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Topic: how to get value of CXTPControlEditPosted: 25 June 2007 at 2:08am |
|
I create a edit in a toolbar,how to get value of the edit. |
|
![]() |
|
xxcln
Newbie
Joined: 05 June 2007 Location: China Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
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
|
|
![]() |
|
xxcln
Newbie
Joined: 05 June 2007 Location: China Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 June 2007 at 7:13am |
|
edit display but unavailable |
|
![]() |
|
xxcln
Newbie
Joined: 05 June 2007 Location: China Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 June 2007 at 2:54pm |
|
ON_XTP_EXECUTE not launch
|
|
![]() |
|
xxcln
Newbie
Joined: 05 June 2007 Location: China Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Posted: 26 June 2007 at 12:44am |
|
Does the message ON_XTP_EXECUTE can't handle in ChildFrame? |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
xxcln
Newbie
Joined: 05 June 2007 Location: China Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
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.
|
|
![]() |
|
Barto
Groupie
Joined: 27 February 2005 Location: Germany Status: Offline Points: 60 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
xxcln
Newbie
Joined: 05 June 2007 Location: China Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Posted: 26 June 2007 at 4:36am |
|
my god ,solve eventually,thanks barto oleg |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |