Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
my question is how to update text into textbox using backgroundworker with dowork event ?

while using runworkercompleted it goes hang the form but with dowork it wont ...

need help
thnxxs
Posted

1 solution

Well, you could use Invoke within the worker DoWork method, but a better idea is to use the ProgressChanged event[^] and pass the string to update with via the ProgressChangedEventArgs parameter's UserState property[^]
 
Share this answer
 
Comments
Rohit Malhotra 9-May-15 6:29am    
thnxxs originalgriff ... solved ....
by using invoke within the worker ....
thnxxs alot .... cya
Rohit Malhotra 9-May-15 6:32am    
solved Code below ®
invoke(sub() textbox1.text = (CInt(database1.items(CInt(rohit)))))
OriginalGriff 9-May-15 6:42am    
You're welcome!
(But the big advantage of the BackgroundWorker is that it makes progress reporting easy via the ProgressChanged event so you don't have to use Invoke! :laugh: )
Sascha Lefèvre 9-May-15 8:08am    
+5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900