Link to home
Start Free TrialLog in
Avatar of hasmet
hasmet

asked on

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.
Avatar of inpras
inpras

Remove default property of UR property pages OK button.
Avatar of hasmet

ASKER

how ? I dont get it ?
Avatar of hasmet

ASKER

I am sorry, I have to reopen it, I just
can not understand your answer !
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
      }
    }
  }
}


ASKER CERTIFIED SOLUTION
Avatar of inpras
inpras

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial