本文整理自网络,侵删。
procedure TForm1.Button3Click(Sender: TObject);var I, L: Integer;
begin Memo1.WordWrap:= False; Memo1.Lines.LoadFromFile('Windows.pas'); I:= Pos('finalization', Memo1.Text); if I > 0 then begin L := SendMessage(Memo1.Handle, EM_LINEFROMCHAR, I - 1, 0); ShowMessage('Found at line ' + IntToStr(L));// if you need to select the text found: Memo1.SelStart := I - 1; Memo1.SelLength := Length('finalization'); Memo1.SetFocus; end;end;
相关阅读 >>
Delphi2010:把stringgrid数据保存到excel
Delphi 二进制值转换十六进制 bintohex和hextobin
更多相关阅读请进入《Delphi》频道 >>