Inheritance Error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two forms that are both derived from the same base class. When I try to
open these inherited forms in the windows form designer, I go back and forth
between the following two errors

1. Object reference not set to an instance of an object
2. The service System.Windows.Forms.Design.IEventHandlerService
already exists in the service container
Parameter name: serviceTyp

Does anyone know why I am getting such errors? Any solutions?
All help is greatly appreciated!! :

Thanks
Parveen
 
Parveen said:
I have two forms that are both derived from the same base class.
When I try to open these inherited forms in the windows form
designer, I go back and forth between the following two errors:

1. Object reference not set to an instance of an object.
2. The service System.Windows.Forms.Design.IEventHandlerService
already exists in the service container.
Parameter name: serviceType

Does anyone know why I am getting such errors? Any solutions?
All help is greatly appreciated!! :)


Examine the code executed in/from the constructor of the base class. The
constructor is executed in the designer because it must create an instance
of the base class to display it.

If there's code in the base class that mustn't be executed when the Form is
opened in the designer, check the Designmode property (if me.designmode...).
It's true in that case.


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
Back
Top