How do I remove clear button in searchbox of listview?

Viewed 2055

I want to put a TEditButton dynamically in searchbox of ListView so I did this:

ListView                         := TListView.Create(Self);    
ListView.Parent                  := Self;   
ListView.Name                    := 'hello'; 
ListView.Height                  := 369;  
ListView.Width                   := 369; 
ListView.Align                   := TAlignLayout.Bottom; 
ListView.SearchVisible           := True; 
ListView.BeginUpdate;    

for i := 0 to ListView.controls.Count - 1 do
begin   
  if ListView.controls[i].ClassType = TSearchBox then 
  begin    
    SearchBox := TSearchBox(ListView.controls[i]);
  end; 
end;  

OKbtn := TEditButton.Create(SearchBox);  
OKbtn.Parent := SearchBox;    
OKbtn.Text   := 'OK';  
OKbtn.Width  := 30;   

SearchBox.AddObject(OKbtn);
ListView.EndUpdate;    

but the problem is the clear button is coming too while editing the searchbox. How can I remove that clear button(X) at the right side of searchbox?

2 Answers
Related