Skip to content

[WinForms] TextFormatFlags.ModifyString is obsolete #20804

Closed

Description

@RussKie

TextFormatFlags.ModifyString is obsolete

Version introduced

.NET 5.0 RC1

Old behavior

TextFormatFlags.ModifyString was available for use.

New behavior

TextFormatFlags.ModifyString is marked as obsolete, with a view to removal in future releases.

Reason for change

Passing a string to TextRenderer.MeasureText() method with TextFormatFlags.ModifyString in some situation will alter the string, which breaks string immutability promise, and may lead to a fatal .NET runtime state corruption.

Recommended action

Update code that relies on TextFormatFlags.ModifyString.

Category

  • Windows Forms

Affected APIs


Issue metadata

  • Issue type: breaking-change

Activity

  1. added
    ⌚ Not Triaged
    breaking-change
    on Sep 28, 2020
  2. added
    🏁 Release: .NET 5
    and removed
    ⌚ Not Triaged
    on Sep 28, 2020
  3. self-assigned this
    on Nov 3, 2020
  4. gewarren commented on Nov 4, 2020

    @gewarren
    Collaborator

    Is there any behavior change here? Or it's just marked obsolete?

  5. RussKie commented on Nov 4, 2020

    @RussKie
    ContributorAuthor

    No behaviour changes for the existing API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

🏁 Release: .NET 5breaking-changewinforms/subsvc

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions