A problem with threads
-
I am a VB.net student and have had a relatively easy go of it til now. For some reason the concept of threading has been a problem for me. Our assignment is to make a ball bounce around the screen (changing directions when it hits a wall). It must us a class (ball). and I understand the basic code of making the ball change directions, but have no idea on how to incorporate this using threads. Any pointers or starters would be great.
-
I am a VB.net student and have had a relatively easy go of it til now. For some reason the concept of threading has been a problem for me. Our assignment is to make a ball bounce around the screen (changing directions when it hits a wall). It must us a class (ball). and I understand the basic code of making the ball change directions, but have no idea on how to incorporate this using threads. Any pointers or starters would be great.
Hi mydrive22. Every application when start has a thread (Primary Thread [PT]). The Thread is a subprocess, this run at same time that PT. For example: When you walk and talk, if this process was a only process you need wait for walk process finish and start the talk process. but if you start 1 process for walk and 1 process for talk, the PT proceess is free for do anything. It's the same with forms. If you use one proceess for retrieve data, you can use the PT for do anything on the form. You need study "System.Threading", "Control.BeginInvoke", "Control.EndInvoke", "System.MulticastDelegate" I hope that this solve your problem
SINCERELY. ANTHONY ACUÑA PREFERED PHRASE: SOMEBODY TELL ME WHY IS MORE REAL WHEN I DREAM THAT I AM WAKE?