dotnet/winforms

Don't force creation of `Handle` in `OnHandleCreated`

オープン

#2,235 opened on 2019/10/29

 (3 件のコメント) (0 件のリアクション) (0 人の担当者)C# (922 件のフォーク)batch import
:beetle: bughelp wantedwaiting-on-team

Repository metrics

Stars
 (4,100 個のスター)
PR merge metrics
 (PR metrics pending)

説明

See https://github.com/dotnet/winforms/pull/2141

The base class Control.OnHandleCreated checks for IsHandleCreated and does nothing if the handle isn't created.

In other sub-classes, we do not check if (IsHandleCreated) before accessing this.Handle which forces creation. This leads to strange recursive behaviour as OnHandleCreated is called again.

My opinion is that we should fix this oversight in base classes to ensure that they don't create the Handle in OnHandleCreated if a Handle doesn't exist

コントリビューターガイド