CEdit in MFC?

Hi all,
I have a dialog, which contains a Edit box. I set the limit text for this edit box is 16. Now I want the first six characters are fixed (I define it  in code for example AAAAAA), and the user can not change it, the 10 characters will be only numbers. Is there any way to do that? Can anyone give me a suggestion?
Thank you very much.
Who is Participating?
alb66Connect With a Mentor Commented:
If you are a VS2008 user you can use the CMFCMaskedEdit class

Otherwise you can handle the WM_CHAR message and do all the stuff by hand
AndyAinscowConnect With a Mentor Freelance programmer / ConsultantCommented:
Text field (right aligned, caption = AAAAAA) and edit field next to it.  Edit field set to numeric only and 10 char maximum.
rambovnAuthor Commented:
Thank you for all of your help.
Andy: you meant that I create two controls, 1st: text field, and the 2nd is edit field??? But if  I create 2, my dialog looks ugly, because for something like that either there is overlap or there is a small line between them.
abl66: I am using VS2008 but which .h file should I include?

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

rambovnAuthor Commented:
Andy: now I know what you meant, but it looks not so nice. Is there any way just using one edit field?
AndyAinscowFreelance programmer / ConsultantCommented:
>>Is there any way just using one edit field?
Have a look at the comment from alb66
rambovnAuthor Commented:
thanks again for all of your help. I am now using alb66's way.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.