【发布时间】:2018-01-09 08:53:08
【问题描述】:
所以基本上我将此代码添加到我的 Form1.Designer.cs:
this.comboBox1.Items.AddRange(Enumerable.Range(0, 30).Cast<object>().ToArray());
这需要在namespace WindowsFormsApp 之上添加using System.Linq;。程序运行得很好,唯一的问题是当我回到 Form1.cs[Design] GUI 部分时,Visual Studio 会返回以下错误:To prevent possible data loss before loading the designer, the following errors must be resolved。
我可以忽略这一点,程序运行良好,但我有点担心。是否有另一种方法可以添加using System.Linq; 行而不会让 VS 对你生气?
【问题讨论】:
-
什么是“以下错误”?
标签: c# visual-studio