Solved

ONOK wont work in a prop-page

Posted on 2000-04-11
5
177 Views
Last Modified: 2013-11-20
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
Comment
Question by:hasmet
  • 2
  • 2
5 Comments
 
LVL 4

Expert Comment

by:inpras
Comment Utility
Remove default property of UR property pages OK button.
0
 
LVL 1

Author Comment

by:hasmet
Comment Utility
how ? I dont get it ?
0
 
LVL 1

Author Comment

by:hasmet
Comment Utility
I am sorry, I have to reopen it, I just
can not understand your answer !
0
 
LVL 1

Expert Comment

by:MT_MU
Comment Utility
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
 
LVL 4

Accepted Solution

by:
inpras earned 150 total points
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now