The exception not set to an instance of an object Error when I use my control

A

active

Got another one. When I put one of my controls on a form I get an error
message: An exception occurred while trying to create an instance of
<mycontrolname>.The exception not set to an instance of an object.

Now my question is: Is there a way to debug what is causing the problem?

I'm guessing the problem occurs while running New. Agree?

Most of what is in New is initializing another of my controls. I could
remove properties from that control one at a time and see when/if the
problem goes away but I hope there's a less painful way then that. Any
ideas?


Cal
 
C

Cor

Hi Cal,

To debug you can remove the text

<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

From the region
#Region "Windows Form Designer generated code"

I hope this helps,

Cor
 
A

active

Cor said:
Hi Cal,

To debug you can remove the text

<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

From the region
#Region "Windows Form Designer generated code"

I hope this helps,

Cor

I've fixed the problem but that is good to know.
I'll be more sensitive to those attributes in the future.

Thanks
Cal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top