Moving Objects in C#

Hello Experts,

I am relatively new to the C3/dot net world (have been in Java and legacy languages).  Can anyone give me a basic example (or point me to a really good article) describing how to dynamically move objects on a Form?

For instnace, I have 2 circles on the form.  When I move one circle down, I want the other circle to move down the same distance (so that they are right across from each other).  I would also like an example of how to move them in opposite directions of each other (whether by the same distance or random distance).

A client side example, along with a web based example, would be appreciated.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

anarki_jimbelSenior DeveloperCommented:
I'd say the question is a bit vague. Is your circle an object? If you do not just draw this circle on a form but instead create a custom control, probably that's easier.

Controls have a number of events that may help with the task, e.g. LocationChanged etc. If you drag a control with a mouse you may use MouseDown and MouseUp events etc.

Could you pls state your task in more details?
mossman243Author Commented:
Yes, I think a control might work.  If memory serves me correct from the old VB days, that was a method to do it.

My task will eventually be to move several objects/controls to a location on the form based on the position of one object/control.  (i.e. if one object is in the top left corner, the other 2 objects are in the lower right corner, etc) Again, if memory serves me correct, I seem to remember having to calculate new xy coordinates for the dependent objects whenever the control object changed in VB, but I am not sure how to do this in C#.

Hope this helps

anarki_jimbelSenior DeveloperCommented:
Really you task is not very simple one. I'd say, in Java it'd be probably easier.

Anyway, look at:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming Languages-Other

From novice to tech pro — start learning today.