
Signature
Stoitcho Goutsev (100) [C# MVP]
Hi Stoitcho,
if you look at the sample in the first mail after
"Currently I am doing this in the parent form ... " (at the end),
you will see, that it has nothing to do with the design mode.
So, your question "whether you want to write you own designers"
is already answered.
Regards,
Dima.
> Yes, it is possible, but the designer uses by default the constructor
> without parameters. The question is whether you want ot write you own
[quoted text clipped - 101 lines]
> > > >
> > > > Which works but it would be cool if I could do it in the constructor.
Stoitcho Goutsev \(100\) [C# MVP] - 21 Jul 2004 14:57 GMT
DRaiko,
Because you followed up my post where I suggested a control rather than a
form is more appropriate , because besides the MDI scenarios when one makes
a form child (TopLevel = false) actually the form becomes child window and
in this case control is more appropriate as lightweight control, your
suggestion will work only in a case when control is created at run time.
If one tries to drag and drop control wich has constructor without
parameters and with parameters designer will use the one without. If you
don't privide constructor without paramters VS will report an error when
trying to add the control.
The problem can be solved by creating a designer to that control. which will
initialize a property with the parent of the control. The same as MainMenu
designer does. However in a case of control (not component) where Parent
will be set as soon as the control is added to the control collection one
cas save some work processing ParentChanged event.
Yor suggestion work when
1. It is a form. Form's always are created at run time
2. It is a control and it is created at run time only. Design time for such
a control won't work.
Again, yes you sollution is ok, but you shouls've followed up the original
post. Form's doesn't have parents they have "owners"

Signature
B\rgds
Stoitcho Goutsev (100) [C# MVP]
> Hi Stoitcho,
>
[quoted text clipped - 112 lines]
> > > > >
> > > > > Which works but it would be cool if I could do it in the constructor.