J
Just Browsing
Hi,
I've been playing around with C# and was trying to put together a small
application that uses multiple threads as a learning exercise. For a simple
(but fun <g>) sample project, I thought I would do a simple game like pong.
Unfortunately it isn't working. My approach was to create a thread for each
object (ball, paddle etc.) and have each thread draw it's "object" back to
the main form. I was able to get each thread to be able to update the Text
property of the form but not it's client area. I guess my main question is
what should be the proper approach? Is having multiple theads writting to
the same form a bad idea (very possible...remember I'm new to C#)? If it is
an ok idea, how should each thread gain access to the form's graphics/client
area?
Any help or pointers to samples or reading would be appreciated.
Thanks
Eric
I've been playing around with C# and was trying to put together a small
application that uses multiple threads as a learning exercise. For a simple
(but fun <g>) sample project, I thought I would do a simple game like pong.
Unfortunately it isn't working. My approach was to create a thread for each
object (ball, paddle etc.) and have each thread draw it's "object" back to
the main form. I was able to get each thread to be able to update the Text
property of the form but not it's client area. I guess my main question is
what should be the proper approach? Is having multiple theads writting to
the same form a bad idea (very possible...remember I'm new to C#)? If it is
an ok idea, how should each thread gain access to the form's graphics/client
area?
Any help or pointers to samples or reading would be appreciated.
Thanks
Eric