I have a class with a Rectangle
property as following:
public class Test {
public Rectangle Rect { set; get; }
}
Outside of the class, I am trying to decrease the height of the Rect
by 20, but I get an error that is not allowed as it's not a variable.
Then I used TestObj.Rect.Inflate(0,-20);
, I had no error but it has no effect on the height of Rect
when I run the program.
I can understand for the same reason as above, it shouldn't work, but why I don't receive any error? Is there a general rule for it?
Then what is the best way to decrease the height of Rect
?