dotnet / dotnet/dotnet-api-docs

System.Windows.Forms.Form missing event hierarchy descriptions

Open
#6,641 0 comments 0 reactions 0 assignees View on GitHub
area-WinForms Pri3 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

Starting from the fact that, not calling the `base.OnLoad()` method in classes derived from the [System.Windows.Forms.Form](https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.form) class, a whole bunch of events does not get raised either, gives lots of unexpected behaviors. I can and would expect for example that the Load event will not be raised when I override `OnLoad` and not call the base implementation, but I would never expect that the Shown event is also not raised in this situation. And who knows what other events are affected.

Current documentation is completely lacking those details. A detailed hierarchy of events and when they are raised/not raised from they base class implementations in the Form class would be very helpful.
The current note like "_When overriding OnLoad(EventArgs) in a derived class, be sure to call the base class's OnLoad(EventArgs) method so that registered delegates receive the event._" does not suffice because it also affects other events

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.