遇到错误变量<变量名称>或者是未声明或从未分配 [英] got error The variable <variable name> is either undeclared or was never assigned

查看:231
本文介绍了遇到错误变量<变量名称>或者是未声明或从未分配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实现的WinForms C#中的大单与Visual Studio 2008。 后工作正常,因为它开始呈现出许多错误masseges作为标题,当我尝试打开设计的对话框的一个很大的部分。

I implement a big form in winforms C# with Visual Studio 2008. after working fine for a big portion of the dialog it start showing a lot of error masseges as in the title when I try to open the designer.

的变量或者是未声明或从未分配

"The variable is either undeclared or was never assigned"

我得到这个对于很多控件之前正常工作。 我认为这与自定义的控制情况,我用

I got this for a lot of controls that worked fine before. I think it happens with custom control that I use

推荐答案

首先推荐的是不要使用任何复杂的逻辑形式的构造,但在窗体的< STRONG> Load事件(在onload方法或重写)。

First recommendation is do not use any complicated logic in the form constructor, but in the form's Load event(or overrides of the OnLoad method).

设计者采用构造的code显示表单,如果你有错误,你的表格会在VS设计师成为不可。

The designer uses the code of constructor to display the form, and if you have errors your form will be "undisplayable" in the VS designer.

其次,每次你在设计问题时,关闭它并重建窗体的项目。验证错误列表窗口中的错误和警告。固定后,在DESIG模式重新打开表单。

Secondly, every time you have problems in the designer, close it and rebuild your form's project. Verify the errors and warnings in the error list Window. After fixing it, reopen your form in desig mode.

这篇关于遇到错误变量&LT;变量名称&gt;或者是未声明或从未分配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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