views:

180

answers:

2

The full .Net framework has an inherited UserControl but this option isn't offered by Visual Studio when creating a new control in a Compact Framework project.

Manually changing the ancestor class of a user control to another user control results in an exception being thrown by the designer when subsequently trying to open it.

Anyone know if user control inheritance is possible?

A: 

I've had success running inherited controls but absolutely none within the designer. I've had to set the parent as Control to use the designer and then set it to my parent control prior to deploying (after closing the designer).

Austin Salonen
Good suggestion, but the whole idea of control inheritance in this case is to use the form designer so that I can add other controls in the subclass and line them up with those in the base class.I think I'll switch to composition rather than inheritance...
Mike Scott
+1  A: 

I have some notes on CF UserControls in this blog entry. The short of it is "Unless you plan to be a control vendor don't bother wasting your time even trying to get designer support working."

ctacke
Thanks, I gave up and went for splitting things up into user controls and reusing them, rather than subclassing. Even that is a PITA though, as I often get exceptions in the designer and have to fiddle around to fix things. VS seems very fragile in this area :-(
Mike Scott