[MFC] TextBox
-
Hi, i have a text Box in my form. mu aim is to force the user to type just numbers in that textBox.But i dont know how to do that. So some plz could help me? i Use the MFC. thank you.
You can use the ES_NUMBER style when creating the control. If the IDE does not expose this style, edit the .rc manually and add it. gmileka
-
You can use the ES_NUMBER style when creating the control. If the IDE does not expose this style, edit the .rc manually and add it. gmileka
georgeraafat wrote:
If the IDE does not expose this style, edit the .rc manually and add it.
Wait, wouldn't the be #define in a header file? :confused:
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum led mike
-
Hi, i have a text Box in my form. mu aim is to force the user to type just numbers in that textBox.But i dont know how to do that. So some plz could help me? i Use the MFC. thank you.
-
georgeraafat wrote:
If the IDE does not expose this style, edit the .rc manually and add it.
Wait, wouldn't the be #define in a header file? :confused:
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum led mike
Yes - ES_NUMBER is defined in winuser.h. The .rc files can include headers. gmileka
-
right click on the edit box->Take properties->Take Style tab-> In it u can find a check box labled Number-> Check it nave
-
Hi, i have a text Box in my form. mu aim is to force the user to type just numbers in that textBox.But i dont know how to do that. So some plz could help me? i Use the MFC. thank you.
CEdit m_Edit; m_Edit.Create(ES_NUMBER|WS_CHILD|WS_VISIBLE|WS_BORDER,CRect(0,0,100,23),this,1); m_Edit.SetWindowText("123"); ---------------------------- m_Edit.ModifyStyle(0,ES_NUMBER); or change Number (ES_NUMBER) to true in window property form your Editbox