Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Work on a new thread locks the GUI

Work on a new thread locks the GUI

Scheduled Pinned Locked Moved C#
mobilequestion
12 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SimpleData
    wrote on last edited by
    #1

    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.

    L M 2 Replies Last reply
    0
    • S SimpleData

      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.

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      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!


      M S 2 Replies Last reply
      0
      • S SimpleData

        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.

        M Offline
        M Offline
        Manas Bhardwaj
        wrote on last edited by
        #3

        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.

        S L 2 Replies Last reply
        0
        • L Luc Pattyn

          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!


          M Offline
          M Offline
          Manas Bhardwaj
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • L Luc Pattyn

            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!


            S Offline
            S Offline
            SimpleData
            wrote on last edited by
            #5

            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?

            L 1 Reply Last reply
            0
            • M Manas Bhardwaj

              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.

              S Offline
              S Offline
              SimpleData
              wrote on last edited by
              #6

              Thank you for your answer but your second link is the same as first. :)

              M 1 Reply Last reply
              0
              • M Manas Bhardwaj

                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.

                L Offline
                L Offline
                Luc Pattyn
                wrote on last edited by
                #7

                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!


                M 1 Reply Last reply
                0
                • S SimpleData

                  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?

                  L Offline
                  L Offline
                  Luc Pattyn
                  wrote on last edited by
                  #8

                  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!


                  S 1 Reply Last reply
                  0
                  • L Luc Pattyn

                    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!


                    S Offline
                    S Offline
                    SimpleData
                    wrote on last edited by
                    #9

                    Oh, sorry somehow I didn't see the link, it's getting late here :). I am reading the article now.

                    S 1 Reply Last reply
                    0
                    • S SimpleData

                      Thank you for your answer but your second link is the same as first. :)

                      M Offline
                      M Offline
                      Manas Bhardwaj
                      wrote on last edited by
                      #10

                      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.

                      1 Reply Last reply
                      0
                      • L Luc Pattyn

                        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!


                        M Offline
                        M Offline
                        Manas Bhardwaj
                        wrote on last edited by
                        #11

                        Luc Pattyn wrote:

                        excuse me, but I don't feel responsible for that MS link at all

                        Oops!!! I meant this [^]

                        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.

                        1 Reply Last reply
                        0
                        • S SimpleData

                          Oh, sorry somehow I didn't see the link, it's getting late here :). I am reading the article now.

                          S Offline
                          S Offline
                          SimpleData
                          wrote on last edited by
                          #12

                          Thank you for showing me that article. It really helped me.

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups