AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Line index in Richedit

Ein Thema von Gutelo · begonnen am 21. Apr 2014 · letzter Beitrag vom 22. Apr 2014
 
Gutelo

Registriert seit: 29. Sep 2013
152 Beiträge
 
#3

AW: Line index in Richedit

  Alt 21. Apr 2014, 22:47
Also fuer den index der ersten sichtbaren Line hab ich folgendes gefunden:

Code:
RichEdit1.Perform(EM_GETFIRSTVISIBLELINE, 0, 0);
Den index der Selection bekommt man mit:

Code:
richedit1.caretpos.y;
Fuer die letzte sichtbare Line:

Code:
function RE_GetLastVisibleLine(RichEdit: TRichEdit): Integer;
const
  EM_EXLINEFROMCHAR = WM_USER + 54;
var
  r: TRect;
  i: Integer;
begin
  {
   The EM_GETRECT message retrieves the formatting rectangle
   of an edit control.
  }
  RichEdit.Perform(EM_GETRECT, 0, Longint(@r));
  r.Left := r.Left + 1;
  r.Top := r.Bottom - 2;
  {
    The EM_CHARFROMPOS message retrieves information about the character
    closest to a specified point in the client area of an edit control
  }
  i := RichEdit.Perform(EM_CHARFROMPOS, 0, Integer(@r.topleft));
  {
    The EM_EXLINEFROMCHAR message determines which
    line contains the specified character in a rich edit control
  }
  Result := RichEdit.Perform(EM_EXLINEFROMCHAR, 0, i);
end;
Quelle: http://delphi.cjcsoft.net//viewthread.php?tid=49413 und http://www.swissdelphicenter.ch/de/showcode.php?id=1213

Geändert von Gutelo (21. Apr 2014 um 23:05 Uhr)
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:51 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz