Hi,
in the DesignHost why should the RootComponent be a Form even when the class
you may be designing is derived from a form?
Take for example a simple object graph of: (A form with 2 buttons and a user
control):
<MyForm>
<button>
<textbox>
<MyUserControl>
When loading this graph in to the designer I alway have to create the
RootComponent as a Form rather than a MyForm, otherwise I find all the
controls on the design surface are readonly / locked. This doesn't follow
the same pattern for the rest of the object graph. For example when I come
to add the MyUserControl to the host I can created an instance of
MyUserControl, not one of its base class.
Hope I'm making sense here!!
Regards
Graham
Robert Conde - 28 Jul 2005 20:03 GMT
It's not that it has to be a form...rather it has to be the base class. So
if you had class MyMyForm : MyForm then you could create a MyForm as the
root component. Why? Well think about it...if it were showing the form
you're working on then it would have to compile first...so if you had
anything in your class that didn't compile you could show the form. Though I
can't put my finger on it I'd think there'd also be an infinite recursion
problem. Anyhow...some things to think about.
Robert Conde
> Hi,
>
[quoted text clipped - 21 lines]
>
> Graham