18. april 2001 - 14:14Der er
7 kommentarer og 1 løsning
Hvordan virker FindDialog1
Jeg vil gerne vide hvordan jeg får FindDialog1 til at søge i min RichEdit2 jeg har en kode der ser sådan her ud ( Taget fra Delpi4 hjælp):
procedure TForm1.FindOrd1Click(Sender: TObject); begin FindDialog1.Execute; end;
procedure TForm1.FindDialog1Find(Sender: TObject); var FoundAt: LongInt; StartPos, ToEnd: integer; begin with RichEdit2 do begin { begin the search after the current selection if there is one } { otherwise, begin at the start of the text }
if SelLength <> 0 then StartPos := SelStart + SelLength else
StartPos := 0;
{ ToEnd is the length from StartPos to the end of the text in the rich edit control }
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;
men der sker ikke noget når jeg trykker på knappen Find Next Hvad er der galt Anold
Write an OnFind event handler to perform the requested search when the user clicks Find Next in the dialog. Use the Options flags to determine how the search is conducted.
Der er ikke de samme søge mulighedder med en Memo comp. men alt kan jo lade sig gøre ( I en gasovn *G* )
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.