문제

This is the property i want to change

This is what i have try:

CartesianGrid cartesianGrid = area.GetGrid<CartesianGrid>();
cartesianGrid.Size = 5;

And this is my error:

Cannot implicitly convert type 'int' to 'System.Drawing.Size'   
도움이 되었습니까?

해결책

As the documentation you linked clearly states, the Size property is expecting an object of type System.Drawing.Size. You are giving it an integer.

Try making a Size object and setting it to that instead. Something like:

cartesianGrid.Size = new Size(5,5);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top