Win Form Events..

  • Thread starter Thread starter Mark Broadbent
  • Start date Start date
M

Mark Broadbent

Anyone know a simple place that i can reference which winform events are
fired by other events (all of them)? I know the bog standard rules for the
Load Activate etc, looking for a comprehensive but simple reference. For
instance I have just seen that the Layout event is fired by the Resize event
(and other events) and it would be nice not to keep discovering what fires
what by trial and error.

thks.

--

--

Br,
Mark Broadbent
mcdba , mcse+i
=============
 
Hi Mark,
Anyone know a simple place that i can reference which winform events are
fired by other events (all of them)? I know the bog standard rules for the
Load Activate etc, looking for a comprehensive but simple reference. For
instance I have just seen that the Layout event is fired by the Resize event
(and other events) and it would be nice not to keep discovering what fires
what by trial and error.

There are protected methods with "On" prefixes that usually fires
events (e.g. OnLoad(...) -> Load)
You can easily override "part" of these methods to find out
their relation.

e.g.

protected override void OnResize(EventArgs e) {
Debug.WriteLine("OnResize - start");
base.OnResize(e);
Debug.WriteLine("OnResize - finish");
}

protected override void OnSizeChanged(EventArgs e) {
Debug.WriteLine("OnSizeChanged- start");
base.OnSizeChanged(e);
Debug.WriteLine("OnSizeChanged- finish");
}

Regards

Marcin
 
Thanks Marcin.

I thought of doing something like this. But surely this must be documented
somewhere (maybe MSDN) -I mean the .NET Win Forms team must have some kind
of model to adhere to?



--

--

Br,
Mark Broadbent
mcdba , mcse+i
=============
 
Back
Top