I have a Tmemo component that can display 10 rows with the current font. There are currently 5 rows assigned, i,e Memo.lines.count -1 = 4. Is there a way to detect when a row is clicked that is greater than the last assigned/displayed row. Example: If I click it the area of row 7, the function returns the last row assigned or row 4. I am looking for feedback that tells me that I am clicking a non-assigned area.
The code below identifies existing rows clicked. Am I missing something?
Thank you for reading.
Vern
from About.com
function SelectMemoLine(Memo : TCustomMemo):integer ;
var
Line : integer;
begin
with Memo do
begin
Line := Perform(EM_LINEFROMCHAR, SelStart, 0) ;
SelStart := Perform(EM_LINEINDEX, Line, 0) ;
SelLength := Length(Lines[Line]) ;
result := Line;
end;
end;
The code below identifies existing rows clicked. Am I missing something?
Thank you for reading.
Vern
from About.com
function SelectMemoLine(Memo : TCustomMemo):integer ;
var
Line : integer;
begin
with Memo do
begin
Line := Perform(EM_LINEFROMCHAR, SelStart, 0) ;
SelStart := Perform(EM_LINEINDEX, Line, 0) ;
SelLength := Length(Lines[Line]) ;
result := Line;
end;
end;