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. Could there be info in it I am missing?
Thank you for reading.
function SelectMemoLine(Memo : TCustomMemo):integer ;
Line : integer;
with Memo do
Line := Perform(EM_LINEFROMCHAR, SelStart, 0) ;
SelStart := Perform(EM_LINEINDEX, Line, 0) ;
SelLength := Length(Lines[Line]) ;
result := Line;