User Control Error

  • Thread starter Thread starter Jorge Cvalheiro
  • Start date Start date
J

Jorge Cvalheiro

Hello
I have create a custom user control and added the project
into another project. It created a tab 'My User Controls'
and added a reference. When i drag the control on a form
i get the following error :

An exception occurred while trying to an instance of
ArtigosArmazem.UserControl1. The exception was "Object
reference not set to an instance of an object.".

Any suggestion on what i am doing wrong would be most
welcome, thank you.

Kind Regards
Jorge Cavalheiro
 
When using a control some of your code may run even though
your in design mode (the control is already in semi-run
mode).

You probably have some things in your control constructor.

Try put something like
If not Me.DesignMode in your control constructor and
figure it out from there.
 
Back
Top