TMemo Question

Is there a way to convert the Rect.Left, Rect.Top values to the SelStart value of the TMemo??

PS: The Rect value is the position of the character in the TMemo

Thanks in Advance
test031097Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ronit051397Commented:
Rect.Left of what?
0
test031097Author Commented:
Ronit...

The Rect.Left is the X position of the character from the Memo itself and Rect.Top is the Y position


0
itamarCommented:
Perhaps, if you explain the objective of that we could help you further. It seems to me that Experts are having some trouble to understand your question.
Dou you want to change the selected area of a memo, or smth like that... ?

Bye,
Itamar
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

test031097Author Commented:
Ok...

Actually, I'm using the TColorMemo (Version 2.0) component from Baltic Solutions and I used it to highlight some HTML Tags

Here's the problem...
I need to highlight the keywords (eg. FACE=, SIZE=) only if it's inside a HTML tag

The component has a DrawKey event that is called whenever a keyword needs to be highlighted and that event only provides the pointer to the keyword and the rectangular area that the keyword occupies...

What I need to do is to get the position of the keyword so that I can used it to check whether it is inside the HTML Tags and then do the necessary stuff

I hope it is clear enough





0
ronit051397Commented:
Is this control descent from TMemo?
0
test031097Author Commented:
Ronit...

I don't know whether this control is a descendant of TMemo
but it does have most properties of it (Eg, SelStart, SelLength, GetTextLen)


0
ronit051397Commented:
I really don't understand what you mean. This is all I can help:

to get the character index by coordinates, call:
lo(ColorMemo1.perform(EM_CHARFROMPOS,0, makelparam(Rect.Left, Rect.Top)));

to get the line index by coordinates, call:
hi(ColorMemo1.perform(EM_CHARFROMPOS,0, makelparam(Rect.Left, Rect.Top)));

0
test031097Author Commented:
What I need is the Position of the character from the text in the Memo.. (Eg, 0 - First character)


0
ronit051397Commented:
the character index is the position of the character. See API's help.
0
test031097Author Commented:
ronit...
Your previous answer works! :-)

Could you please repost the answer so that I can give u the points?

Thanks


0
ronit051397Commented:
OK...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.