Skip to content

[Breaking change]: ListBox.DefaultItemHeight constant field is marked as obsolete #33953

Closed

Description

@Tanya-Solyanik

Description

ListBox.DefaultItemHeight is no longer used as the default item height for the ListBox control because now item height is proportional to the current application font. This change is necessitated by the introduction of the new default font for WinForms controls in .NET Core 3.1.

Version

.NET 8 Preview 2

Previous behavior

Applications referencing ListBox.DefaultItemHeight constant compiled with no warnings related to this value.

New behavior

Applications referencing ListBox.DefaultItemHeight constant will compile with the following warning:
WFDEV004: ListBox.DefaultItemHeight` constant is no longer used as the default item height. Default item height is now scaled according to the application default font.

Type of breaking change

  • Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
  • Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code may require source changes to compile successfully.
  • Behavioral change: Existing binaries may behave differently at run time.

Reason for change

The new default ListBox item height value is calculated dynamically, based on the application font.

Recommended action

Use Control.DefaultFont.Height values instead.

Feature area

Windows Forms

Affected APIs

ListBox.DefaultItemHeight


Associated WorkItem - 63465

Activity

  1. added
    breaking-change
    on Feb 10, 2023
  2. added
    ⌚ Not Triaged
    source incompatible
    on Feb 10, 2023
  3. added
    🏁 Release: .NET 8
    and removed
    ⌚ Not Triaged
    on Feb 10, 2023
  4. added
    🗺️ reQUEST
    on Feb 10, 2023
  5. added
    📌 seQUESTered
    and removed
    🗺️ reQUEST
    on Feb 10, 2023
  6. ghost added
    in-pr
    on Mar 14, 2023
  7. moved this from 🔖 Ready to 🏗 In progress in dotnet/docs March 2023 sprinton Mar 14, 2023
  8. gewarren commented on Mar 14, 2023

    @gewarren
    Collaborator
  9. ghost removed
    in-pr
    on Mar 17, 2023
  10. gewarren commented on Nov 29, 2023

    @gewarren
    Collaborator

    Now seems to depend on dotnet/winforms#10142.

  11. removed
    🏁 Release: .NET 8
    on Dec 11, 2023
  12. gewarren commented on Apr 8, 2025

    @gewarren
    Collaborator

    Closing this breaking change, since it wasn't implemented.

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

Metadata

Metadata

Assignees

Labels

📌 seQUESTeredbreaking-changesource incompatible

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions