This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
Version introduced: .NET 10 Preview 1
Form.OnClosing,Form.OnClosed and the corresponding events are obsolete. UseForm.OnFormClosing,Form.OnFormClosed,Form.FormClosing andForm.FormClosed instead.
These methods and events are provided for backwards compatibility and they shouldn't be used. Instead, reference the replacement methods and events.
Replace the obsolete member with the new member:
| Old member | New member |
|---|---|
| Form.OnClosing | Form.OnFormClosing |
| Form.OnClosed | Form.OnFormClosed |
| Form.Closing | Form.FormClosing |
| Form.Closed | Form.FormClosed |
Suppress the warning with either of the following methods:
Set the severity of the rule in the.editorConfig file.
[*.{cs,vb}]dotnet_diagnostic.WFDEV004.severity = noneFor more information about editor config files, seeConfiguration files for code analysis rules.
Add the followingPropertyGroup to your project file:
<PropertyGroup> <NoWarn>$(NoWarn);WFDEV004</NoWarn></PropertyGroup>Suppress in code with the#pragma warning disable WFDEV004 directive.
For more information, seeHow to suppress code analysis warnings.
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?
Was this page helpful?
Want to try using Ask Learn to clarify or guide you through this topic?