How to get text from a text box control pertaining to cursor position
-
Hello All, I am changing the cursor position for inserting,updating and deleting the text in a text box control. I am able to get the cursor position pertaining to the current cursor location though. Please suggest me the way to find the text pertaining to the cursor. Thanks and Regards. Amar.
-
Hello All, I am changing the cursor position for inserting,updating and deleting the text in a text box control. I am able to get the cursor position pertaining to the current cursor location though. Please suggest me the way to find the text pertaining to the cursor. Thanks and Regards. Amar.
From VC++ Help:
CEditView::GetSelectedText void GetSelectedText( CString& strResult ) const; Parameters strResult: A reference to the CString object that is to receive the selected text. Remarks Call GetSelectedText to copy the selected text into a CString object, up to the end of the selection or the character preceding the first carriage-return character in the selection.
A tip... Try checking the help. Go to index view, write the name of the control and at the bottom of the help text usually is "CLASS MEMBERS" link. With all the possible things you can do by default with that control/class.Greetings. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson