Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The TextFormatFlags.ModifyString field is obsolete, as a warning, and may be removed in a future .NET version.
Change description
In previous .NET versions, the TextFormatFlags.ModifyString enumeration field is not marked obsolete. In .NET 5 and later versions, it is marked obsolete as a warning. This field may be removed in a future .NET version.
Reason for change
Passing a string to TextRenderer.MeasureText with TextFormatFlags.ModifyString alters the string in some situations. This behavior breaks the string immutability promise and may lead to a fatal .NET runtime state corruption.
Version introduced
.NET 5.0
Recommended action
Update any code that relies on TextFormatFlags.ModifyString.