Edit Box
-
hi all, is it possible to get the cursor position in the edit box like the cursor is after 3 chars from the start or 5 chars from the start like that . "Men never do evil so completely and cheerfully as when they do it from religious conviction" -Pascal
-
hi all, is it possible to get the cursor position in the edit box like the cursor is after 3 chars from the start or 5 chars from the start like that . "Men never do evil so completely and cheerfully as when they do it from religious conviction" -Pascal
chethu665 wrote:
s it possible to get the cursor position in the edit box like the cursor is after 3 chars from the start or 5 chars from the start like that .
Use GetCurPos and CEdit::CharFromPos at tandum!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You
-
hi all, is it possible to get the cursor position in the edit box like the cursor is after 3 chars from the start or 5 chars from the start like that . "Men never do evil so completely and cheerfully as when they do it from religious conviction" -Pascal
Check this article.It has some info related to getting cursor position. http://www.codeproject.com/editctrl/editctrltutorial.asp[^] Appu.. "If you judge people, you have no time to love them."
-
hi all, is it possible to get the cursor position in the edit box like the cursor is after 3 chars from the start or 5 chars from the start like that . "Men never do evil so completely and cheerfully as when they do it from religious conviction" -Pascal
p=m_edit.GetCaretPos ();
int t=m_edit.CharFromPos (p);
//t has the value that you need
/*CString s;
s.Format("%d",t);
AfxMessageBox(s);*/******m_edit is the edit box control and p is a POINT type variable Uncomment the above 3 lines that are commented to print the value in the message box. Does this help you? Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_ -- modified at 8:31 Monday 5th June, 2006
-
hi all, is it possible to get the cursor position in the edit box like the cursor is after 3 chars from the start or 5 chars from the start like that . "Men never do evil so completely and cheerfully as when they do it from religious conviction" -Pascal
Hey, Check the MSDN Documentation related to GetSel and EM_GETSEL http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/editcontrols/editcontrolreference/editcontrolmessages/em_getsel.asp[^] Appu.. "If you judge people, you have no time to love them."
-
p=m_edit.GetCaretPos ();
int t=m_edit.CharFromPos (p);
//t has the value that you need
/*CString s;
s.Format("%d",t);
AfxMessageBox(s);*/******m_edit is the edit box control and p is a POINT type variable Uncomment the above 3 lines that are commented to print the value in the message box. Does this help you? Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_ -- modified at 8:31 Monday 5th June, 2006
-
Hey, Check the MSDN Documentation related to GetSel and EM_GETSEL http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/editcontrols/editcontrolreference/editcontrolmessages/em_getsel.asp[^] Appu.. "If you judge people, you have no time to love them."
NiceNaidu wrote:
GetSel and EM_GETSEL
Sorry to trouble you,This Will Retrive the Selected Text not actual Caret Position
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You