Re: [Notes2-team] Pra quem quiser ajudar...
Brought to you by:
andersonrb
From: Joelson <joe...@ya...> - 2003-11-03 18:08:26
|
Olá amigo Anderson aqui vai alguns códigos que pode ajudar... //este procedimento procura o texto.... procedure TFvisimp.FindDialog1Find(Sender: TObject); var FoundAt: LongInt; StartPos, ToEnd: Integer; begin with RichEdit1 do begin if SelLength <> 0 then StartPos := SelStart + SelLength else StartPos := 0; ToEnd := Length(Text) - StartPos; FoundAt := FindText(FindDialog1.FindText, StartPos, ToEnd, [stMatchCase]); if FoundAt <> -1 then begin SetFocus; SelStart := FoundAt; SelLength := Length(FindDialog1.FindText); end; end; end; //este procedimento substitui textos var SelPos: Integer; begin with TReplaceDialog(Sender) do begin SelPos := Pos(FindText, RichEdit1.Lines.Text); if SelPos > 0 then begin RichEdit1.SelStart := SelPos - 1; RichEdit1.SelLength := Length(FindText); RichEdit1.SelText := ReplaceText; end else MessageDlg(Concat('A palavra "', FindText, '" não foi encontrada no relatório.'), mtError, [mbOk], 0); end; end; se ainda não tiver encontrado a função de verificar o estado da tecla me de um toque q mando pra vc hj a noite pelo icq... essas acima tava mais fácil pq tenho no meu sistema e o mesmo ta aberto nesse instante... no mais um abraço Joelson |