我有这个
The class foo can be designed, but is not the first class in the file
在我的 C# 文件中添加从 TextBox 派生的 foo 类后出错。怎么能传过去呢,很烦人。
编辑:
我想在我的文件中包含多个类。我想要一些从 TextBox 派生的类,它们接受特定类型的输入。我没有使用设计器。
编辑2:
class NumericTextBox : TextBox
{
protected override void OnTextChanged(EventArgs e)
{
...
}
}
最佳答案
您的文件中必须有多个类。将您的类(class)在文件中向上移动,以便它可以成为该文件中的第一个类(class)
Visual Studio 要求负责创建文件的类位于该文件的顶部或第一类
关于c# - 类foo可以设计,但不是文件错误中的第一个类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8864359/