04-10-2011, 07:07 PM
كود :
procedure TForm1.Button1Click(Sender: TObject);
var
L,M,i,j : integer;
found : boolean;
begin
found := false;
for i := 0 To RichEdit1.Lines.Count do
begin
L:=[color=Red]pos[/color](Edit1.Text,RichEdit1.Lines[i]);
Label1.Caption:='la ligne de texte est a la position '+ IntToStr(i+1);
if L <> 0 then
begin
M := 0;
for j := 0 to i-1 do
M := M+length(RichEdit1.Lines[j]);
M := M+(i*2);
M := M+L-1;
RichEdit1.SetFocus;
RichEdit1.SelStart := M;
RichEdit1.SelLength := length(Edit1.Text);
found := True;
Break;
end;
end;
If found =False then
ShowMessage('Non trouvé!!');
end;للمزيد من المعلومات أنظر هذا الموضوع
http://www.delphi4arab.net/forum/showthr...p?tid=2584

