471,616 Members | 1,338 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,616 software developers and data experts.

ShowInTaskBar change raises user control load event

I have a main form (Form1) which opens a second form (Form2) when a button
is clicked. Form2 has .FormBorderStyle set to FixedSingle.

Form2 contains two buttons, one which unpins it from Form1 by setting
..ShowInTaskBar to true,
and setting .Owner to false. The other buttons click event reverses, this
by setting .Owner to the
form1 instance, and .ShowIntTaskBar to false.

This all works fine, with Form2appearing in the taskbar and the alt tab list
as expected.

The problem is that Form2 also contains a user control, who's Load event is
fired each time either button is clicked.
This problem is triggered by the change to the .ShowInTaskBar property, not
the .Owner property.

The load event of the hosted form is not triggered, just any hosted user
controls.

I have two questions...
1. Is this expected behavior. ( i can find no mention of this anywhere )
2. Is there a way to prevent this from occurring other than resorting to
setting a global flag which can be tested in
each user controls load event. In reality I have lots of user controls, so
this is not a very appealing option.

Any help or insight would be greatly appreciated.

Cheers.
Jul 21 '05 #1
0 1213

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Charles A. Lackman | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.