How does one find the coordinates halfway on the X and Y axis in a user control or form?
How can I identify the range of the X-axis and the Range of the Y axis on a user control or form?
How does one find the coordinates halfway on the X and Y axis in a user control or form?
How can I identify the range of the X-axis and the Range of the Y axis on a user control or form?
You are probably looking for the ClientRectangle property.
To find the range: do you mean the range on screen? if so, use the RectangleToScreen
function.
To find the middle point, you can use
Rectangle r = this.ClientRectangle;
Point p = new Point(
(int)((r.X + r.Width) / 2),
(int)((r.Y + r.Height) / 2));
What does axis mean in your context?
Given the Height and Width properties, you should be able to work out the halfway position (remembering that Y is positive downwards!)
If, however, you are implementing axes in your own units, you will want to create some helper functions to convert from your units to pixels (and back, potentially)