Click here to Skip to main content
16,014,892 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionWhy canot disable the popup menu item? Pin
Anonymous26-Nov-02 3:32
Anonymous26-Nov-02 3:32 
AnswerRe: Why canot disable the popup menu item? Pin
Roger Allen26-Nov-02 4:50
Roger Allen26-Nov-02 4:50 
GeneralInput validation Pin
Andy H26-Nov-02 3:17
Andy H26-Nov-02 3:17 
GeneralRe: Input validation Pin
roel_26-Nov-02 4:04
roel_26-Nov-02 4:04 
GeneralRe: Input validation Pin
Roger Stewart26-Nov-02 4:58
professionalRoger Stewart26-Nov-02 4:58 
GeneralRe: Input validation Pin
perlmunger26-Nov-02 7:08
perlmunger26-Nov-02 7:08 
GeneralRe: Input validation Pin
valikac26-Nov-02 8:09
valikac26-Nov-02 8:09 
GeneralRe: Input validation Pin
Mike Eriksson26-Nov-02 23:52
Mike Eriksson26-Nov-02 23:52 
I'm assuming you have an modal dialog for entering a number of values.

First you need to decide when the validation should be performed. Directly when the user is inputing the value into the editbox or when he are done with the input and accepts (presses OK or Enter).

The latter one is easier, in OnOK() call a function which validates the entered value and if it returns true everything is ok and you can close the dialog else you need to pput up some error and let the user try again.

Validating during input is a bit trickier, but if you use a masked edit control it's not that hard. Microsoft has one, Insert ActiveX control - Microsoft Masked Edit Control (msmask32.ocx). I use one from Dundas, which they gave away for free a long time ago! It's a very small part of there Toolbox. You will find several attempts here on CodeProject also... http://www.codeproject.com/editctrl/#Masked%20and%20Validating%20controls[^]

Hope this will help you!



Mike Eriksson
Sonork 100.21825
GeneralCDialog::OnPaint() doesn't get called Pin
User 665826-Nov-02 3:15
User 665826-Nov-02 3:15 
GeneralRe: CDialog::OnPaint() doesn't get called Pin
Jeff Patterson26-Nov-02 3:44
Jeff Patterson26-Nov-02 3:44 
GeneralOOPS Re: CDialog::OnPaint() doesn't get called Pin
Jeff Patterson26-Nov-02 3:51
Jeff Patterson26-Nov-02 3:51 
GeneralEmbeded Object Pin
millertm26-Nov-02 2:58
millertm26-Nov-02 2:58 
QuestionHow to create thread ? Pin
rrrado26-Nov-02 2:45
rrrado26-Nov-02 2:45 
AnswerRe: How to create thread ? Pin
Joaquín M López Muñoz26-Nov-02 2:58
Joaquín M López Muñoz26-Nov-02 2:58 
GeneralRe: How to create thread ? Pin
rrrado26-Nov-02 3:38
rrrado26-Nov-02 3:38 
GeneralRe: How to create thread ? Pin
Alexandru Savescu26-Nov-02 6:16
Alexandru Savescu26-Nov-02 6:16 
GeneralRe: How to create thread ? Pin
valikac26-Nov-02 8:11
valikac26-Nov-02 8:11 
Generalplease give me guidlines Pin
vgkotha26-Nov-02 2:39
vgkotha26-Nov-02 2:39 
GeneralRe: please give me guidlines Pin
Michael P Butler26-Nov-02 3:45
Michael P Butler26-Nov-02 3:45 
GeneralRe: please give me guidlines Pin
vgkotha26-Nov-02 4:04
vgkotha26-Nov-02 4:04 
Generaldll hell - pls help Pin
Chris Eatough26-Nov-02 2:06
Chris Eatough26-Nov-02 2:06 
GeneralRe: dll hell - pls help Pin
roel_26-Nov-02 4:08
roel_26-Nov-02 4:08 
GeneralDifference in size of MFC and ASNI C Pin
Tili26-Nov-02 1:58
Tili26-Nov-02 1:58 
GeneralRe: Difference in size of MFC and ASNI C Pin
roel_26-Nov-02 4:10
roel_26-Nov-02 4:10 
GeneralAbstract class as interface Pin
s o v a n n26-Nov-02 1:27
s o v a n n26-Nov-02 1:27 

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.