简体   繁体   中英

VS 2010 Designer error when passing arguments to custom's control main function

I've written a custom control. I need a public function from the parent form, the control is in. So I pass the instance in the designer like this:

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

But the VS designer throws an error ans says:

The variable 'control' is either undeclared or was never assigned.

This sounds like a designer issue to me. Just do;

  • Re-build your current solution
  • Restart Visual Studio

As an alternative, you can create seperate assembly dll for custom controls.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM