Click here to Skip to main content
15,999,253 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Can someone help me?

I am trying to change the the location of the point inside the object, eg it's on the top left hand corner side of the object. Is it possible to change the location of that point? if so, how?
Posted
Updated 10-Feb-11 20:20pm
v2
Comments
Albin Abel 11-Feb-11 1:32am    
Are you mean the graphic point? If you can access the point then how @ the x and y of it. The coordinates refers to the objects coordinate space.

May be you need to explain more @ your problem
[no name] 11-Feb-11 1:34am    
Yes I mean the comer on the x/y point of the object

1 solution

You can do it, but you have to either assign a new Point:
myControl.Location = new Point(myControl.Location.X + 10, myControl.Location.Y - 20);

or by moving the Top and / or Left Properties:
myControl.Left += 10;
myControl.Top -= 20;
 
Share this answer
 
Comments
[no name] 11-Feb-11 3:14am    
But doesn't that just change the position of the whole object?
OriginalGriff 11-Feb-11 3:55am    
Isn't that what you are trying to do?
If not, then please explain in more detail what you are trying to achieve!
[no name] 11-Feb-11 4:00am    
Its not. well as you know there is a point in a picturebox its about 1 pixel in the top left hand corner and that is what you can tell where the location of the object is, but im looking within the object where the point is in the box that shows the location, not the location of the whole object of the box, i wanna change the location of the top left hand corner of the box to a different place, eg. center, or i could increase the diameter of the point in the box. I hope that explains it
OriginalGriff 11-Feb-11 4:07am    
No. I am none the wiser.
"about 1 pixel in the top left hand corner and that is what you can tell where the location of the object is" - Nope, never heard of it. How can you tell?
[no name] 11-Feb-11 4:22am    
Well take

If (Death.Bounds.Contains(You.Location))
{
LOL.text = "Im in the box";
}

As a example then, if the top part of the box in that part the code will execute but if the bottom of the box is in there, nothing will happen

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900