Click here to Skip to main content

C / C++ / MFC

 
QuestionHow to stop typing in CDateTimeCtrl in MFC Pinmemberrahul.kulshreshtha7-Nov-12 17:47 
AnswerRe: How to stop typing in CDateTimeCtrl in MFC PinmemberJochen Arndt8-Nov-12 0:32 
GeneralRe: How to stop typing in CDateTimeCtrl in MFC Pinmemberrahul.kulshreshtha8-Nov-12 6:52 
GeneralRe: How to stop typing in CDateTimeCtrl in MFC PinmemberJochen Arndt8-Nov-12 7:32 
You are using MFC, so you don't need to handle PreTranslateMessage(). Just use the wizard to derive a class, use the message properties to add the WM_CHAR handler, and comment the line calling CDateTimeCtrl::OnChar(). Done with a few mouse clicks. All you need to type in using the keyboard is the name of the drived class, the comment chars, and replacing the CDateTimeCtrl by your class name in your code.
 
The edit control of CDateTimeCtrl is not accessible. So it can't be done in the dialog. Even when it would be possible: It is always better to perform such things in the control rather than in the dialog. So it must be done only once and not within every dialog that uses such a control.
Question[MFC] How to save three ini files as zip file? Pingroupyu-jian7-Nov-12 6:20 
AnswerRe: [MFC] How to save three ini files as zip file? Pinmemberjeron17-Nov-12 7:17 
AnswerRe: [MFC] How to save three ini files as zip file? PinmemberProgramFOX7-Nov-12 8:35 
QuestionWhy new Image failed? Pingroupyu-jian7-Nov-12 5:06 
AnswerRe: Why new Image failed? PinmemberAndrew Cherednik7-Nov-12 13:12 
AnswerRe: Why new Image failed? PinmemberSanthosh G_7-Nov-12 13:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.150327.1 | Last Updated 27 Mar 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid