Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 364
  • Last Modified:

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
0
test031097
Asked:
test031097
  • 5
  • 5
1 Solution
 
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now