so, i'm making a small text chat program that uses a WebClient and xml parsing on the returning text (PHP scripts from SSL/HTTPS server). First my 'heartbeat' was a timer, but that made the gui kinda freeze for fractions of seconds when I was dragging the box around
I decided to make a backgroundworker, gui was smooth but I can't put anything in the message box cause of this cross thread problem, which i've done some research on and people suggested it not be used (CheckForIllegalCrossThreadCalls). I used it and it worked just fine. What if I'm just adding text to a richtextbox, That textbox is only hit by this one background process, so i'm not sure how the main thread and worker thread could collide.
I'm also trying to 'collect' messages in a dictionary or collection and make a timer execute and show the messages in the collection and reset the collection at the end of the bgworker call and stop the timer at the end of the tick, since timers are non-blocking, but its not executing, can you start a timer from a background worker?
anyone have any better solutions, please go ahead. All I need to do is hammer through these small problems and the rest of it should be simple
I decided to make a backgroundworker, gui was smooth but I can't put anything in the message box cause of this cross thread problem, which i've done some research on and people suggested it not be used (CheckForIllegalCrossThreadCalls). I used it and it worked just fine. What if I'm just adding text to a richtextbox, That textbox is only hit by this one background process, so i'm not sure how the main thread and worker thread could collide.
I'm also trying to 'collect' messages in a dictionary or collection and make a timer execute and show the messages in the collection and reset the collection at the end of the bgworker call and stop the timer at the end of the tick, since timers are non-blocking, but its not executing, can you start a timer from a background worker?
anyone have any better solutions, please go ahead. All I need to do is hammer through these small problems and the rest of it should be simple