CS0571' ResizeSettings.Width.set':无法显式调用operator或accessor

时间:2018-03-19 02:31:27

标签: c#

我正在尝试构建此方法,但却遇到了主题错误。

解决此问题的正确格式是什么?

ResizeSettings settings1 = new ResizeSettings();
settings1.set_Width(size.Width); // error thrown here.

1 个答案:

答案 0 :(得分:0)

尝试:

ResizeSettings settings1 = new ResizeSettings();
settings1.Width = size.Width;