Work on a new thread locks the GUI
-
Hi I have an application which uploads files over FTP. I create a new thread and start uploading on that thread but GUI locks while this upload takes place. As far as I know because I am not uploading on main thread GUI should not lock and it should stay responsive. What am I doing wrong? If you need the code please tell me. Thanks.
-
Hi I have an application which uploads files over FTP. I create a new thread and start uploading on that thread but GUI locks while this upload takes place. As far as I know because I am not uploading on main thread GUI should not lock and it should stay responsive. What am I doing wrong? If you need the code please tell me. Thanks.
it would be wrong to: - have an event handler start the thread and wait for it to finish; - have the thread touch any Control or windows-related Component, including Windows.Forms.Timer; this[^] explains it. If neither apply, we will need to see some code. :)
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
-
Hi I have an application which uploads files over FTP. I create a new thread and start uploading on that thread but GUI locks while this upload takes place. As far as I know because I am not uploading on main thread GUI should not lock and it should stay responsive. What am I doing wrong? If you need the code please tell me. Thanks.
SimpleData wrote:
What am I doing wrong? If you need the code please tell me.
You should rather try to use Backgroundworker [^]class. In between, you should also read a **great reply from Luc [^]**to one one the questions couple of days back. This would also help you get you things clear. :thumbsup:
Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
it would be wrong to: - have an event handler start the thread and wait for it to finish; - have the thread touch any Control or windows-related Component, including Windows.Forms.Timer; this[^] explains it. If neither apply, we will need to see some code. :)
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
Ah!!! there you are... just gave him the link to your one of the replies yesterday :)
Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
SimpleData wrote:
What am I doing wrong? If you need the code please tell me.
You should rather try to use Backgroundworker [^]class. In between, you should also read a **great reply from Luc [^]**to one one the questions couple of days back. This would also help you get you things clear. :thumbsup:
Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
Thank you for your answer but your second link is the same as first. :)
-
it would be wrong to: - have an event handler start the thread and wait for it to finish; - have the thread touch any Control or windows-related Component, including Windows.Forms.Timer; this[^] explains it. If neither apply, we will need to see some code. :)
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
Thank you for your answer. My thread is interacting with a progressbar. What would be the correct way to interact with the progressbar without locking the GUI?
-
SimpleData wrote:
What am I doing wrong? If you need the code please tell me.
You should rather try to use Backgroundworker [^]class. In between, you should also read a **great reply from Luc [^]**to one one the questions couple of days back. This would also help you get you things clear. :thumbsup:
Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
excuse me, but I don't feel responsible for that MS link at all... :omg:
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
-
Thank you for your answer. My thread is interacting with a progressbar. What would be the correct way to interact with the progressbar without locking the GUI?
why don't you read what I gave you? :(
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
-
why don't you read what I gave you? :(
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
Oh, sorry somehow I didn't see the link, it's getting late here :). I am reading the article now.
-
Thank you for your answer but your second link is the same as first. :)
Sorry, for the wrong link. This [^]is the one.
Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
excuse me, but I don't feel responsible for that MS link at all... :omg:
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
Luc Pattyn wrote:
excuse me, but I don't feel responsible for that MS link at all
Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
Oh, sorry somehow I didn't see the link, it's getting late here :). I am reading the article now.
Thank you for showing me that article. It really helped me.