foo类可以设计,但不是文件错误中的第一个类 [英] The class foo can be designed, but is not the first class in the file error

查看:22
本文介绍了foo类可以设计,但不是文件错误中的第一个类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个

类 foo 可以设计,但不是文件中的第一个类

The class foo can be designed, but is not the first class in the file

在我的 C# 文件中添加从 TextBox 派生的 foo 类后出错.怎么传啊,好烦.

error after adding foo class derived from TextBox in my C# file. How can I pass it, it's very annoying.

我想在我的文件中有多个类.我想要一些从接受特定类型输入的 TextBox 派生的类.我没有使用设计器.

I want to have multiple classes in my file. I want to have some classes derived from TextBox that accept specific types of input. I'm not using the designer.

编辑 2:

class NumericTextBox : TextBox
{
    protected override void OnTextChanged(EventArgs e)
    {
        ...
    }
}

推荐答案

您的文件中必须有多个类.将您的类在文件中向上移动,使其成为该文件中的第一个类

You must have more than one classes in your file. Move your class up in the file so that it can be the first class in that file

Visual Studio 要求负责创建文件的类位于该文件的顶部或第一类

Visual Studio requires class that was responsible for creation of file to be on top or first class of that file

这篇关于foo类可以设计,但不是文件错误中的第一个类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆