Click here to Skip to main content
15,880,608 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Currently I'm working on improvements of an existing project (it's quite big) concerning the administration of screens (about 250 screens for data input, setup and presentation of results). I decided to create a abstract base class which forces the derived screens to implement some basic functionality.

Now I suffer from the problem that the designer refuses to show the affected screens after I edited it in (see A, B and C.

To show you my problem I created a test-program which you can download here.
After you move one of the buttons in the derived screen and recompile, the designer refuses to show the user interface until you restart visual studio.

I'm curious if it's possible to work around the limitation of the designer without using #IF DEBUG or intermediate classes which aren't abstract.

Many thanks in advance,
Robert

What I have tried:

By googling I've already solved the basic problem that the designer (Visual Studio 2012 Update 5) normally can't show screens which are derived from an abstract base class by providing a TypeDescriptionProvider. I found the principle I use described in here.
Posted
Updated 22-Sep-16 3:28am

1 solution

That's a problem I've been complaining about since VS2005!
You can't directly display any control that is based on a derived class, but there is a kludge round it: Deriving a concrete class from an abstract UserControl[^]
It's not ideal in any way, but it works.
 
Share this answer
 
Comments
Robert Zuckerstätter 22-Sep-16 10:07am    
Hi OriginalGriff,
thanks for your solution. I already knew your post from 10/2013.

I wanted to explicitly ask, if it's possible to solve the issue without differentiating between Debug and Release-mode.

Your solution probably will be my workaround (and accepted answer), if no one can provide a more elegant one.
For now I'll leave the topic open to give others the chance to contriubute.

From a technical point of view I think I undestand why the guys at microsoft implemented it that way, but from a practical point of view it's quite annoying.

Thanks again,
Robert
OriginalGriff 22-Sep-16 10:15am    
I'll be watching closely - I'd love a better solution myself! :laugh:
Robert Zuckerstätter 6-Oct-16 7:59am    
After two weeks of waiting and watching, your solution is still the only (and so best) approach for the described issue. I already changed the code in my project last week and it works fine.
I hope the guys at MS think about improving the designer in this manner in future versions.

Thanks for your help!
OriginalGriff 6-Oct-16 8:03am    
You're welcome!
I wish they would... :sigh:

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900