[英]C# How do I access the second half of the rectangle structure's coordinates
This may be a simple question but I can't seem to find the answer after googling or going on the MSDN! 这可能是一个简单的问题,但是在谷歌搜索或使用MSDN后,我似乎找不到答案!
I have defined a rectangle using the following: 我使用以下命令定义了一个矩形:
gridSecondRect3 = new Rectangle(324, 172, 471, 304);
I understand the first 2 number are the stating x & y, and the last 2 are the finishing x&y of the rectangle. 我知道前2个数字是x&y的后缀,后2个是矩形的x&y的精加工。
I understand how to access the first two using gridSecondRect3.X (or .Y) 我了解如何使用gridSecondRect3.X(或.Y)访问前两个
However, I would like to know how to access the last 2 numbers. 但是,我想知道如何访问最后两个数字。
I've tried using the .Height & .Width operators, however it didn't work. 我尝试使用.Height和.Width运算符,但是没有用。
Use Right and Bottom properties. 使用权和底部的性质。
Rectangle.Right Property Rectangle.Right属性
Returns the x-coordinate of the right side of the rectangle. 返回矩形右侧的x坐标。
Rectangle.Bottom Property Rectangle.Bottom属性
Returns the y-coordinate of the bottom of the rectangle . 返回矩形底部的y坐标。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.