dotnet / dotnet/winforms

FormClosed event is raised twice for owned modal window when owner window is closed programatically

Open
#2,451 2 comments 0 reactions 0 assignees View on GitHub
:beetle: bug help wanted
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
1d 13m
Merged PRs (30d)
85

Description

See attached sources. I can reproduce this issue with .Net Core 3.0 and .Net Framework 4.7.2

The second call to OnFormClosed() seems to be a side effect of shutting down the modal message loop that was created to run the child window.

[BugFormClosedRaisedTwice.zip](https://github.com/dotnet/winforms/files/3903629/BugFormClosedRaisedTwice.zip)

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.