albertovesx Posted March 15, 2013 Share Posted March 15, 2013 Hi to all. I modified the LiveComboBox demo to display an image beside the text. When an item is selected, I remove the HTML marks to only display the text. but it does it with a blink that I dont like at all. Is there a better approach to do this? procedure TMainForm.UniComboBox1RemoteQuery(const QueryString: string; Result: TStrings); var I: Integer; begin if Trim(QueryString)='' then Exit; ClientDataSet1.Filter:='country LIKE ''%'+QueryString+'%'''; ClientDataSet1.First; while not ClientDataSet1.Eof do begin Result.Add( '<div><img src="img/accept.png" align="left"/>' +ClientDataSet1.FieldByName('country').AsString +'</div>' ); ClientDataSet1.Next; end; end; procedure TMainForm.UniComboBox1Select(Sender: TObject); begin UniComboBox1.Text := StringReplace( UniComboBox1.Text, '<div><img src="img/accept.png" align="left"/>', '', [] ); UniComboBox1.Text := StringReplace( UniComboBox1.Text, '</div>', '', [] ); end; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.