First off, I wouldn't use Progress reporting for that - I'd use that to add each item as it was processed, not the whole lot at once.
For a "single action" I'd handle the
RunWorkerCompleted Event[
^] instead as it's more obvious when is happening.
But your progress handling code doesn't help you at all:
AutoCompleteStringCollection list_of_member = (AutoCompleteStringCollection)e.UserState;
txtsearch.AutoCompleteCustomSource.AddRange(e.UserState);
Why cast the UserState to a useful type if all you do is ignore it and use the original
object
variable to set the range?
Since there isn't an AddRange overload that takes an
object
parameter, that probably doesn't even compile ...