Advertisement
zizzo81

AsSearcbox inner core

Jan 11th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.72 KB | None | 0 0
  1. procedure TAsSearchBox.Change;
  2. begin
  3.   inherited;
  4.   if Assigned(FdataSet) and FdataSet.Active and (LoadFilter(Self.Text) <> '') and (FSearchActive) then begin
  5.     with FdataSet do begin
  6.       Filtered := false;
  7.       if Self.GetTextLen <> 0 then begin
  8.         try
  9.           if not FsearchOptions.FCaseSensitive then
  10.             FilterOptions := [foCaseInsensitive];
  11.           Filter := LoadFilter(Self.Text);
  12.           Filtered := True;
  13.           if not(IsEmpty) then Color := FColorFound
  14.           else Color := FColorNotFound;
  15.         except
  16.           Color := FColorNotFound;
  17.         end;
  18.       end else begin
  19.         FdataSet.Filtered := false;
  20.         Color := FNormalColor;
  21.       end;
  22.     end;
  23.   end;
  24. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement