Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

ONOK wont work in a prop-page

I have a propertysheet with 4 pages.
I want return function locally in a control.
for example I have an edit control and when user enters while in it, I want to handle it
and still keep the sheet and page.
Only if they tab to ok button and return, then the dialog should close.
0
hasmet
Asked:
hasmet
  • 2
  • 2
1 Solution
 
inprasCommented:
Remove default property of UR property pages OK button.
0
 
hasmetAuthor Commented:
how ? I dont get it ?
0
 
hasmetAuthor Commented:
I am sorry, I have to reopen it, I just
can not understand your answer !
0
 
MT_MUCommented:
Have you tryed overriding PreTranslateMessage?  

You should be able to do something like

BOOL CPropPAge::PreTranslateMessage(MSG* pMsg)
{
 if (pMsg->message == WM_KEYDOWN)
  {
    if (pMsg->wParam == WM_RETURN)
    {
      CWnd* pWnd = GetFocus();      
      if (::GetDlgCtrlID(pWnd->m_hWnd)) == MyControl)
      {
         // handle the return here
      }
    }
  }
}


0
 
inprasCommented:
Hi
Ok U do the folowing go to resource
go to prperties of UR edit box set the property want return U R prblem is solved and for other controls like push button U have to derive the class from CButton and override Pretranslate message in tpretranslate message check if message == WM_KEYDOWN and lParam == 0x13 then return FALSE thats all
Hope this helps
inpras
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now