1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35:
| function GridFindText(const Grid: TStringGrid; const FindDialog: TFindDialog; Msg, Rowselect: Boolean): Boolean; var i, r, c: Integer; FindStr, RowStr, ColStr: String; begin Result := False;
if not Rowselect then begin if frDown in FindDialog.Options then begin for i := Grid.Col+1 to Grid.ColCount-1 do begin if Pos(FindDialog.FindText, Grid.Cells[i, Grid.Row]) > 0 then begin Grid.Col := i; Result := True; exit; end; end; end else begin for i := Grid.Col-1 downto 0 do begin if Pos(FindDialog.FindText, Grid.Cells[i, Grid.Row]) > 0 then begin Grid.Col := i; Result := True; exit; end; end; end; end; |