Click here to Skip to main content
15,914,409 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem linkage Pin
Nish Nishant2-Dec-04 20:50
sitebuilderNish Nishant2-Dec-04 20:50 
GeneralOnly Numeric value in Edit Box Pin
zahid_ash2-Dec-04 19:42
zahid_ash2-Dec-04 19:42 
GeneralRe: Only Numeric value in Edit Box Pin
Vikram Kashyap2-Dec-04 19:51
Vikram Kashyap2-Dec-04 19:51 
GeneralRe: Only Numeric value in Edit Box ( Where i catch the key press event ) Pin
zahid_ash2-Dec-04 20:43
zahid_ash2-Dec-04 20:43 
GeneralRe: Only Numeric value in Edit Box Pin
Nish Nishant2-Dec-04 20:45
sitebuilderNish Nishant2-Dec-04 20:45 
GeneralRe: Only Numeric value in Edit Box Pin
zahid_ash2-Dec-04 21:01
zahid_ash2-Dec-04 21:01 
GeneralRe: Only Numeric value in Edit Box Pin
Nish Nishant2-Dec-04 21:26
sitebuilderNish Nishant2-Dec-04 21:26 
GeneralRe: Only Numeric value in Edit Box Pin
Vikram Kashyap2-Dec-04 21:54
Vikram Kashyap2-Dec-04 21:54 
hi..

You need to derive a new class using CEdit as the base class. There you can code either OnKeydown() or OnChar(, or PreTranslateMessage() message to suit your needs.

For PreTranslateMessage() here is the code...Hope it'll help you

BOOL CMyEdit::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message == WM_KEYDOWN )
{
int nVirtKey = (int) pMsg->wParam;
if(nVirtKey >= 97 && nVirtKey <= 122) //For Lower Case
{
MessageBox("Cannot enter alphabets");
}

if(nVirtKey >= 65 && nVirtKey <= 90) //For Upper Case
{
MessageBox("Cannot enter alphabets");
}
}
return CEdit::PreTranslateMessage(pMsg);
}


Bye...

Roll eyes | :rolleyes:

Vikram Kashyap
"You will never fail until you stop trying"
GeneralRe: Only Numeric value in Edit Box Pin
David Crow3-Dec-04 2:18
David Crow3-Dec-04 2:18 
GeneralHelp me... Pin
dSolariuM2-Dec-04 19:32
dSolariuM2-Dec-04 19:32 
GeneralRe: Help me... Pin
Vikram Kashyap2-Dec-04 19:55
Vikram Kashyap2-Dec-04 19:55 
GeneralRe: Help me... Pin
david_gilmour2-Dec-04 21:07
david_gilmour2-Dec-04 21:07 
GeneralRe: Help me... Pin
David Crow3-Dec-04 2:20
David Crow3-Dec-04 2:20 
Generalmessagebox problem Pin
tiziacaia2-Dec-04 18:41
tiziacaia2-Dec-04 18:41 
GeneralRe: messagebox problem Pin
Nish Nishant2-Dec-04 19:27
sitebuilderNish Nishant2-Dec-04 19:27 
GeneralRe: messagebox problem Pin
tiziacaia3-Dec-04 5:45
tiziacaia3-Dec-04 5:45 
GeneralRe: messagebox problem Pin
V.2-Dec-04 23:15
professionalV.2-Dec-04 23:15 
AnswerRe: How much overhead does std::vector have? Pin
John R. Shaw2-Dec-04 18:30
John R. Shaw2-Dec-04 18:30 
AnswerRe: How much overhead does std::vector have? Pin
Tim Smith3-Dec-04 4:31
Tim Smith3-Dec-04 4:31 
GeneralRe: How much overhead does std::vector have? Pin
Robert Buldoc3-Dec-04 6:55
Robert Buldoc3-Dec-04 6:55 
QuestionMaking my own OpenGL, what to do about wgl* entrypoints? Pin
maxmaven2-Dec-04 18:23
maxmaven2-Dec-04 18:23 
GeneralPlease help immediately!! Pin
angello62-Dec-04 18:03
angello62-Dec-04 18:03 
GeneralRe: Please help immediately!! Pin
John R. Shaw2-Dec-04 18:50
John R. Shaw2-Dec-04 18:50 
GeneralRe: Please help immediately!! Pin
david_gilmour2-Dec-04 21:29
david_gilmour2-Dec-04 21:29 
GeneralRe: Please help immediately!! Pin
Jon Hulatt3-Dec-04 2:22
Jon Hulatt3-Dec-04 2:22 

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

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