Rich - posicao do cursor (linha e coluna) |
Top Previous Next |
|
procedure TForm1.ApplicationEvents1Idle(Sender: TObject; var Done: Boolean); var Row, Col: Integer; begin // Find out what line we are on, based on the current selection's // end (start + length). Row := SendMessage(Richedit1.Handle, EM_EXLINEFROMCHAR, 0, RichEdit1.SelStart + RichEdit1.SelLength); // Find the column, from the selection end, minus the char we are on Col := RichEdit1.SelStart + RichEdit1.SelLength - SendMessage(Richedit1.Handle, EM_LINEINDEX, -1, 0); // Display it in a status bar Statusbar1.SimpleText := IntToStr(Row+1)+ ' ' + IntToStr(Col+1) + ' ' + DateTimeToStr(Now); end; |