
April 14th, 2012, 10:36 AM
|
|
Registered User
|
|
Join Date: Apr 2012
Posts: 3
Time spent in forums: 1 h 23 m 42 sec
Reputation Power: 0
|
|
|
TFindDialog
Hey people. I am new to this site and i subscribed just for help. My school teacher assigned me a project in which i need to develop a windows notepad like application. So everything went well and i didn't came across any difficulties apart from finding text in the memo lines using a TFindDialog. I have searched the Internet and found some code which i didn't understand very well. So i decided to write my own. The problem is that i don't know how to get the index of the last line of the memo. Here is my code(I don't know if it works i am just experimenting)
procedure TForm1.FindDialog1Find(Sender: TObject);
var
i : integer;
begin
for i := Memo1.CaretPos.Y to {Here i want to put the index of the last line} do
if pos(FindDialog1.FindText,Memo1.Lines[i]) <> 0 then
begin
Memo1.SelStart := pos(FindDialog1.FindText,Memo1.Lines[i]) - 1;
Memo1.SelLength := length(FindDialog1.FindText);
Memo1.SetFocus;
end;
end;
By the way i am relatively new to the delphi programming...
Sorry for my English!!!!
|