Dotnetjunky,
AFAIK you can't unless you create your own custom designer and serialize
code that sets the form reference to a property of your component. See how
MainMenu, for example, gets the reference to the form.

Signature
HTH
Stoitcho Goutsev (100) [C# MVP]
> Hi experts,
>
[quoted text clipped - 8 lines]
>
> Dotnetjunky
Dotnetjunky - 21 Sep 2004 02:45 GMT
Hi, thanks for your answer. Here's the next question :-), hope you can help
me too.
So now, I have successfullly hooked up to the parent Form's event. In the
event handler, my component would perform some checking on the machine. If
the check fails, I want to close the Form and exit the main application. If I
call Application.Exit(), nothing happens. If I call parent.Close(), the form
does close, but all the event handlers registered to the form's
Closed/Closing events get fired before that, which I don't want. Not to
mention that the Closing event handlers can stop the form from closing by
setting Cancel property of the CancelEventArgs object to 'false'. How to
workaround this issue ? What I want is close the form immediately without any
other subsequent actions performed.
Thanks in advance.
"Stoitcho Goutsev (100) [C# MVP]" wrote:
> Dotnetjunky,
>
[quoted text clipped - 14 lines]
> >
> > Dotnetjunky
Stoitcho Goutsev \(100\) [C# MVP] - 21 Sep 2004 14:28 GMT
Hi Dotnetjunky,
Do you have more code after Application.Exit? Some code after
Application.Exit might stop the the application from exiting (e.g. showing
message boxes). This has good chances to happen if you have more then one
Load event handlers. Application.Exit should be the last thing you do before
exit.
Anyways if it is not the case and you can't find out what cause this
behavior you can workaround by calling Environment.Exit instead. But bear in
mind that unlike Application.Exit which stops only the message loops in the
application domain Environment.Exit ends the process. Which in turn means
that if you run more then one application domains in the same process they
will be closed as well.

Signature
HTH
Stoitcho Goutsev (100) [C# MVP]
> Hi, thanks for your answer. Here's the next question :-), hope you can
> help
[quoted text clipped - 40 lines]
>> >
>> > Dotnetjunky
Vlado B. - 22 Sep 2004 15:07 GMT
Hello everyone,
I have the same problem. I want to reference parent form from my component.
I implemented ComponentDesigner but thats all I know and can do.
Can you give me a hint how to find reference through ComponentDesigner (or
some other designer) ???
TIA,
Vlado