restricting to type in CEdit
-
Hi all, Can anybody know how to restrict to type fixed number of characters in the CEdit control. Thanks. The Phantom.
-
open Class Wizard and assign a CString variable for your edit and you will see "Maximum characters" in the lower part of the Class Wizard. Set there how many characters your CString wants to have.(same for int, long...)
if u want to assign a CEdit ctrl as the data member to the Edit Ctrl then u can call the function-->> EditCtrl.SetLimitText(VALUE_of_memeber_u_want ); i hope this solve ur query Thanx TAKE CARE
-
open Class Wizard and assign a CString variable for your edit and you will see "Maximum characters" in the lower part of the Class Wizard. Set there how many characters your CString wants to have.(same for int, long...)
-
Hi all, Can anybody know how to restrict to type fixed number of characters in the CEdit control. Thanks. The Phantom.
Use the
CEdit::SetLimitText()
. You can use DDX for this but it's better to restrict the text length as you are typing rather than wait until the OK button has been clicked (i.e., validating in theOnOK()
handler is too little too late).