Most static analysis tools have a significant flaw - they're only working on general patterns, and they often don't handle all of the "valid" exceptions to their rules. There are almost always valid exceptions to the rules built into the static analysis rule engines.
In this case, you can't (and shouldn't) dispose of the form when using .Show()
. The form will get disposed correctly when it is closed. This is effectively a "false" error, in this specific case.
In this case, you should ignore this specific error, as it's a false positive.