all groups > dotnet compact framework > october 2005 >
You're in the

dotnet compact framework

group:

Inherited Form (childform) and OnActivate Event


Inherited Form (childform) and OnActivate Event Norbert
10/21/2005 4:40:51 AM
dotnet compact framework:
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).

[quoted text, click to view]
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
Re: Inherited Form (childform) and OnActivate Event Norbert
10/21/2005 7:48:00 AM
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
Re: Inherited Form (childform) and OnActivate Event ctacke/
10/21/2005 9:09:11 AM
Put it in OnLoad an use a condiftional flag to make sure it's only used when
you want.

-Chris


[quoted text, click to view]

AddThis Social Bookmark Button