Click here to Skip to main content
15,913,587 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionWTL User Interface in MFC application Pin
Mircea Grelus12-Oct-05 22:15
Mircea Grelus12-Oct-05 22:15 
AnswerRe: WTL User Interface in MFC application Pin
Mircea Grelus12-Oct-05 22:18
Mircea Grelus12-Oct-05 22:18 
GeneralRe: WTL User Interface in MFC application Pin
l a u r e n13-Oct-05 17:25
l a u r e n13-Oct-05 17:25 
GeneralRe: WTL User Interface in MFC application Pin
Mircea Grelus14-Oct-05 4:47
Mircea Grelus14-Oct-05 4:47 
QuestiontmapsEnumurate Folder Pin
Saber00112-Oct-05 21:54
Saber00112-Oct-05 21:54 
Questionedit box that accepts only 0-9 and "ABCDCDEF" Pin
kerby_arion12-Oct-05 21:53
kerby_arion12-Oct-05 21:53 
AnswerRe: edit box that accepts only 0-9 and "ABCDCDEF" Pin
toxcct12-Oct-05 22:03
toxcct12-Oct-05 22:03 
AnswerRe: edit box that accepts only 0-9 and "ABCDCDEF" Pin
ddmcr12-Oct-05 22:31
ddmcr12-Oct-05 22:31 
You can also use cotrol subclassing.
Just derive a new class , for example CMyEdit,from CEdit and overload the WM_CHAR message handler for the new class ,like this :

void CMyEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
        TCHAR c = (TCHAR) nChar;

	if(c=='A'||c=='B'||c=='C'||c=='D'||isdigit(c))
        {
         //call base class OnChar() function
         CEdit::OnChar(nChar, nRepCnt, nFlags);
	}
}


After this , create an Edit box on your dialog and attach a CMyEdit variable to it. Then you will be able to type inside only "0123456789ABCD" letters



"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill



-- modified at 4:42 Thursday 13th October, 2005
GeneralRe: edit box that accepts only 0-9 and "ABCDCDEF" Pin
Trollslayer13-Oct-05 1:20
mentorTrollslayer13-Oct-05 1:20 
GeneralRe: edit box that accepts only 0-9 and "ABCDCDEF" Pin
kerby_arion13-Oct-05 15:41
kerby_arion13-Oct-05 15:41 
GeneralRe: edit box that accepts only 0-9 and "ABCDCDEF" Pin
ThatsAlok13-Oct-05 18:54
ThatsAlok13-Oct-05 18:54 
GeneralRe: edit box that accepts only 0-9 and "ABCDCDEF" Pin
ddmcr13-Oct-05 22:26
ddmcr13-Oct-05 22:26 
GeneralRe: edit box that accepts only 0-9 and "ABCDCDEF" Pin
kerby_arion14-Oct-05 1:41
kerby_arion14-Oct-05 1:41 
Questionsetting a max char length of combo box or and edit control? Pin
kerby_arion12-Oct-05 20:30
kerby_arion12-Oct-05 20:30 
AnswerRe: setting a max char length of combo box or and edit control? Pin
The NULL Developer12-Oct-05 20:48
professionalThe NULL Developer12-Oct-05 20:48 
GeneralRe: setting a max char length of combo box or and edit control? Pin
kerby_arion12-Oct-05 21:32
kerby_arion12-Oct-05 21:32 
GeneralRe: setting a max char length of combo box or and edit control? Pin
kerby_arion12-Oct-05 21:50
kerby_arion12-Oct-05 21:50 
AnswerRe: setting a max char length of combo box or and edit control? Pin
toxcct12-Oct-05 21:27
toxcct12-Oct-05 21:27 
GeneralRe: setting a max char length of combo box or and edit control? Pin
kerby_arion14-Oct-05 1:50
kerby_arion14-Oct-05 1:50 
GeneralRe: setting a max char length of combo box or and edit control? Pin
kerby_arion14-Oct-05 1:52
kerby_arion14-Oct-05 1:52 
Questionini to xml conversion Pin
swaapu12-Oct-05 20:21
swaapu12-Oct-05 20:21 
QuestionUSB drive letter Pin
LiYS12-Oct-05 20:14
LiYS12-Oct-05 20:14 
Questionoleacc.dll & WinNT problem Pin
Mohammad Tarik12-Oct-05 19:33
Mohammad Tarik12-Oct-05 19:33 
Questioninvoking CWnd::SetWindowPos () in COleControl sub-class meber-function takes no effect! Pin
suchuhui12-Oct-05 19:08
suchuhui12-Oct-05 19:08 
Questionhelp me plz????????????????????////// Pin
knowledgelover12-Oct-05 16:10
knowledgelover12-Oct-05 16:10 

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.