|
-
February 7th, 2010, 10:33 AM
#1
Moving objects
Hi everyone,
I've been learning C# for a couple of months now, and I've ran into a problem.
I've drawn a Circle (FillEllipse) with the Paint-event. Now, I'd like the circle to move around in a specific area.
Is there an easy way I can make the circle move around (randomly), and bounce off panel "walls"?
Greetings,
Tom
-
February 7th, 2010, 11:38 AM
#2
Re: Moving objects
I haven't really worked with it, but WPF together with Expression Blend, could make your life a little easier.
Expression Blend is a Microsoft program for designers, et enables you to animate and completely customize the WPF controls. You should check it out.
-
February 7th, 2010, 03:51 PM
#3
Re: Moving objects
Thanks for sharing 
Unfortunately, I'm bound to use only C#, without any add-ons / plug-ins..
So I really need something that I can get directly from C# / .NET..
Sorry to be such a pain
-
February 7th, 2010, 05:37 PM
#4
Re: Moving objects
WPF is .NET, i think it was added in .NET 3.5.
It's just an alternative to the normal forms. You can edit the design of the forms with XML, much like you would edit a web page with HTML.
If you are using visual studio there is a project template for WPF, and Expression Blend integrates quite well with visual studio. (right click a desig-file as choose edit in expression blend)
Take a look at this article: http://www.codeproject.com/KB/WPF/WPFAnimation.aspx
It explains how to do animations in WPF
Last edited by jonlist; February 7th, 2010 at 07:33 PM.
-
February 8th, 2010, 08:08 AM
#5
Re: Moving objects
Found it!
Thanks a lot
-
February 8th, 2010, 08:31 AM
#6
Re: Moving objects
Please specify what version of .NET you are using in future, as explained here :
http://www.codeguru.com/forum/showthread.php?t=401115
-
February 9th, 2010, 01:52 PM
#7
Re: Moving objects
Create a timer.
At each timer event:
- change the coordinates of your circle,
- invalidate the control you are drawing on.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|