edit control
-
hi all i want to fix the limit of edit control it means that it can take only five digits that is 12345 after that we can not add any digit to it so tell me thanks Ashish Dogra MCA Noida
Right click on the edit control and where you add a variable set the maximum and minimum values for the edit control. the variable associated with the edit control is of integer type Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
See
SetLimitText
andLimitText
_**
**_
whitesky
i set this with int length=2; if(m_sh.GetLimitText()>length) { m_sh.SetLimitText(length); } but it doenot limit the text thanks Ashish Dogra MCA Noida
-
i set this with int length=2; if(m_sh.GetLimitText()>length) { m_sh.SetLimitText(length); } but it doenot limit the text thanks Ashish Dogra MCA Noida
Under which function u wrote this code? try to write this code in the second line of OnInitDialog() function. Hope it will help. Regards, Ram
-
i set this with int length=2; if(m_sh.GetLimitText()>length) { m_sh.SetLimitText(length); } but it doenot limit the text thanks Ashish Dogra MCA Noida
Test this code
m_Edit.LimitText(3);
orm_Edit.SetLimitText(3);
and answer me it work or not,please_**
**_
whitesky
-
Under which function u wrote this code? try to write this code in the second line of OnInitDialog() function. Hope it will help. Regards, Ram
sir thanks for reply but it will not work in oninitdialog() function Ashish Dogra MCA Noida
-
Test this code
m_Edit.LimitText(3);
orm_Edit.SetLimitText(3);
and answer me it work or not,please_**
**_
whitesky
i try this code in oninitdialog function but not work Ashish Dogra MCA Noida
-
sir thanks for reply but it will not work in oninitdialog() function Ashish Dogra MCA Noida
CEdit* ed = (CEdit*)GetDlgItem(IDC_EDIT1); //replace the IDC_EDIT1 with the properties ID of the edit box ed->LimitText(5); Try this!!!!!!!!!!! Regards, Ram
-
i try this code in oninitdialog function but not work Ashish Dogra MCA Noida
But i tested this code and it work how you to use_**
**_
whitesky
-
i try this code in oninitdialog function but not work Ashish Dogra MCA Noida
Test this code,its working
CEdit m_Edit;//Declare in class not function
m_Edit.Create(WS_CHILD|WS_VISIBLE,CRect(0,0,100,23),this,1);m_Edit.LimitText(3);
-
But i tested this code and it work how you to use_**
**_
whitesky
i want to tell you on thing that i enter values in edit control from buttons which are on the dialog box i have ten buttins and when i press buttons values appear on edit control. Ashish Dogra MCA Noida
-
i want to tell you on thing that i enter values in edit control from buttons which are on the dialog box i have ten buttins and when i press buttons values appear on edit control. Ashish Dogra MCA Noida
well,when you want to insert your values to editbox you can check length values before insert_**
**_
whitesky