| View previous topic :: View next topic |
| Author |
Message |
Sabetay Toros Guest
|
Posted: Mon Jan 17, 2005 1:10 pm Post subject: TMemo Editing |
|
|
Hi,
Is there a quick way to determine which line is beign edited or changed in
TMemo.
Thanks
Sabetay
|
|
| Back to top |
|
 |
Hans Galema Guest
|
Posted: Mon Jan 17, 2005 2:14 pm Post subject: Re: TMemo Editing |
|
|
Sabetay Toros wrote:
| Quote: | Is there a quick way to determine which line is beign edited or changed in
TMemo.
|
void __fastcall TForm1::Memo1Change(TObject *Sender)
{
int line = SendMessage (
((TMemo*)Sender)->Handle
, EM_LINEFROMCHAR
, ((TMemo*)Sender)->SelStart
, 0
);
Label3->Caption = "line " + IntToStr ( line );
}
Hans.
|
|
| Back to top |
|
 |
Maarten Guest
|
Posted: Mon Jan 17, 2005 3:27 pm Post subject: Re: TMemo Editing |
|
|
"Sabetay Toros" <bilsarbiz (AT) ttnet (DOT) net.tr> wrote:
| Quote: | Hi,
Is there a quick way to determine which line is beign edited or changed in
TMemo.
Thanks
Sabetay
I think the following code should also work: |
void __fastcall TForm1::Memo1Change(TObject *Sender)
{
TPoint P = Memo1->CaretPos;
Label1->Caption = "column " + IntToStr(P.x);
Label2->Caption = "line " + IntToStr(P.y);
}
|
|
| Back to top |
|
 |
Hans Galema Guest
|
Posted: Mon Jan 17, 2005 7:54 pm Post subject: Re: TMemo Editing |
|
|
Maarten wrote:
| Quote: | I think the following code should also work:
TPoint P = Memo1->CaretPos;
|
Much better.
Hans.
|
|
| Back to top |
|
 |
|