On 16/04/2008, Jon Foster <[EMAIL PROTECTED]> wrote: > I'm trying to determine where the which line in a TMemo the cursor is > on. In Delphi I could use CaretPos. I didn't find anything in the > documentation for TMemo that indicated there was any way to do this. Is > there some way to determine the cursor position within the lines > property of a TMemo? >
err, this is probably a hack, but you can use pos(lineending, memo.lines.text) in a loop to count how many newlines before you get to memo.selstart. then rposex(lineending, memo.lines.text, memo.selstart) to find how far you are in the line you are. works in gtk2, at least (can send code if i don't make sense :). henry _______________________________________________ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus