【问题标题】:VS 2010 Designer error when passing arguments to custom's control main function将参数传递给自定义的控件主函数时出现 VS 2010 Designer 错误
【发布时间】:2013-07-15 10:14:13
【问题描述】:

我编写了一个自定义控件。我需要父窗体中的公共函数,控件在其中。所以我在设计器中传递实例,如下所示:

this.control= new mainform.control(this);

但是 VS 设计者抛出错误 ans 说:

变量“control”要么未声明,要么从未赋值。

【问题讨论】:

    标签: c# designer


    【解决方案1】:

    对我来说,这听起来像是设计师的问题。做就行了;

    • 重新构建您当前的解决方案
    • 重启 Visual Studio

    作为替代方案,您可以为自定义控件创建单独的程序集 dll。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多