For Programmers: Free Programming Magazines  


Home > Archive > Delphi > November 2004 > WordWrap problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author WordWrap problem
Tankseruba

2004-11-26, 9:10 pm

hello,

I have Memo (or RichEdit) with WordWrap=True option.

I have 2 problems:
1. I want get edited line number, but like WordWrap=False
2. I want get value of Lines[n], but like WordWrap=False

I tried
- .CaretPos.y
- .Lines[n]
- switch WordWrap=True temporary

but it doesn't work.

Can you help me?

Tankseruba
Jamie

2004-11-26, 9:10 pm

Tankseruba wrote:

> hello,
>
> I have Memo (or RichEdit) with WordWrap=True option.
>
> I have 2 problems:
> 1. I want get edited line number, but like WordWrap=False
> 2. I want get value of Lines[n], but like WordWrap=False
>
> I tried
> - .CaretPos.y
> - .Lines[n]
> - switch WordWrap=True temporary
>
> but it doesn't work.
>
> Can you help me?
>
> Tankseruba

look at the EM_CHARFROMPOS in the win32 help
you need to pass the X,Y Mouse locations to that message
it will return the line index and charactor index.
you need to use the SendMessage(Memo1.handle,
EM_CHARFROMPOS,MAKELPARAM(X,Y));
the return value is a DWORD (double word), the low word
is the charactor index and the high order word line index.
etc..



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com