I have function that returns the index of a character GetCharFromPos(Pt: TPoint): Integer;
now i wanted to get character of that position. like GetCharByIndex(Index: Integer): Char;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The efficient way to do this using pure VCL is to use
SelStart,SelLengthandSelText.You’ll likely want to save away the selection before modifying it, and then restore it once you have read the character.
This is however a rather messy way to read a character. If you are prepared to use raw Win32 API then you can make use of
EM_GETTEXTRANGE.