unit uClearSearch; interface uses //Declarar na Uses FMX.Edit, FMX.ListView; type TClearSearch = Class helper for TListView procedure ClearSearchListView(); end; implementation { TClearSearch } procedure TClearSearch.ClearSearchListView; var SearchListView: TSearchBox; i: Integer; begin SearchListView := nil; //Procura o componente Search da ListView e atribui SearchListView for i := 0 to Self.ComponentCount -1 do begin if (Self.Components[i] is TSearchBox) then begin SearchListView := Self.Components[i] as TSearchBox; break; end; end; //E aqui ele apaga o Search que ele encontrou if (SearchListView <> nil) then SearchListView.Text := ''; end; end.
Modo de usar:
//Não esqueça de declarar a Unit na uses ListView.ClearSearchListView;
Top! Obrigado por compartilhar.
ResponderExcluir