Inherited Form (childform) and OnActivate Event

  • Thread starter Thread starter Norbert
  • Start date Start date
N

Norbert

Hello

Working under VS 2005 Beta2 & Visual C#

I'd like to have a form (lets call it splashScreen) which prints a big
company logo on the background of the form (full screen).
From this I want to derive several differnt other forms with different
labels/buttons/.. on it.

The problem is, that in one derived class I overwrite to OnActivated
method to update a label text which I added in the derived form.

But the OnActivated method is called to early, in the
IniatializeComponent method of my base class. At this time the label is
not available (null pointer) and I get an exception (or I check if its
null but then its not updated)!

Somebody know how to handle this?
I cannot move this label text updated in the OnLoad method because I
reuse this Form several times.

Hopefully somebody can help

Norbert
 
Put it in OnLoad an use a condiftional flag to make sure it's only used when
you want.

-Chris
 
Thanks for the quick answer, I think the conditional flag is going to
be my solution
for this problem

To your suggestion to put it in OnLoad:
I only want to load this form once and show/hide it during runtime, to
speed it up.
The OnLoad method is only called once, when loading the Form for the
first time!
(As far as i tested it.)

Is there some overview when exaclty the Load,Activate.... Event Occurs?
the MSDN doku is there quite vague.

regards Norbert
 
Back
Top