简体   繁体   中英

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!

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.

I understand how to access the first two using gridSecondRect3.X (or .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.

Use Right and Bottom properties.

Rectangle.Right Property

Returns the x-coordinate of the right side of the rectangle.

Rectangle.Bottom Property

Returns the y-coordinate of the bottom of the rectangle .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM