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

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

问题描述

我是 vb.net 的新手,我正在进行我的第一个应用程序......并在 msdn 中找到了一些示例代码,所以我刚刚替换了我的 Form1.vb 文件内容与来自 MSDN 的内容.当我回滚更改并尝试编译我的旧代码时,出现了数百个错误,当我切换到 Form1[Design] 选项卡时,我看到了:

I'm a newbie on vb.net, and I was in progress with my first application... and found some example code in the msdn so I just replaced my Form1.vb file content with the content from the MSDN. When I roll back the changes, and tried to compile my old code then hundreds of errors appeared, and when I switch to the Form1[Design] tab I see this:

Form1 类是可以设计的,但不是第一类文件.Visual Studio 要求设计人员使用文件.移动类代码,使其成为文件中的第一个类并尝试再次加载设计器.

The class Form1 can be designed, but is not the first class in the file. Visual Studio requires that designers use the first class in the file. Move the class code so that it is the first class in the file and try loading the designer again.

我真的是 vb.net 和 Visual Studio 本身的新手,我不知道在这种情况下该怎么办,我的工作被破坏了还是什么?

I'm really new on vb.net and the visual studio itself, and I dont know what to do in this case, is my work destroyed or what?

推荐答案

那是因为您在 form1.vb 中的类定义上方添加了一些类或其他代码.删除那个.

That's because you added some class or other code above the class definition in form1.vb. Remove that.

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

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