Solved

Inherited forms don't show up in VS designer

Posted on 2004-04-20
2
343 Views
Last Modified: 2008-12-11
Visual inheritance was working just fine until now. The designer shows the parent form OK but the inherited ones gave me this error:
 
System.Windows.Forms.Design.IEventHandlerService service already exists in the service container. Parameter name: serviceType
 
Now the designer has changed its message and what I get is "Object reference not sent to an instance of an object". I opened the task list to see in which file the error was and there's nothing in the file column of the list. If I double click the task it just places me on the first line of code in the file where the form is declared.
 
The application still works fine though so I guess this must be an error with Visual Studio and not with my code.

0
Comment
Question by:SergioFlorezM
2 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 200 total points
ID: 10873675
I had problem similar to that and I found that some parent form's events (like the Load event) are runned in the IDE when child forms are displayed.

Try removing the code from these events.
0
 
LVL 8

Expert Comment

by:nishikanth
ID: 10875096
This seems to have something to do with inheriting a Form_Load function from the base form. remove the Form_Load form the template and you will stop getting this error.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now