Skip to content

[HDPI] Cursor editor in propertyGrid is not scaled well #9007

Closed

Description

@Olina-Zhang

.NET version

dotnet-sdk-8.0.100-preview.4.23218.19

Did it work in .NET Framework?

Yes

Did it work in any of the earlier releases of .NET Core or .NET 5+?

Yes, it doesn't reproduce in .Net 7.0 SDK build.

Issue description

On High DPI environment, cursor editor in propertyGrid is not scaled well

Result on .Net 8.0 Preview 4 build with 300%DPI:
image
Issue2

Result on .Net 7.0 build with 300%DPI:
image

Steps to reproduce

Sample app:
WinFormsApp89.zip

Activity

  1. added
    untriaged
    area-HDPI
    💥 regression-preview
    on Apr 20, 2023
  2. dreddy-work commented on Apr 21, 2023

    @dreddy-work
    Member

    @Olina-Zhang, can you see which preview in 8.0 introduced this? or better yet, which PR?

  3. Olina-Zhang commented on Apr 23, 2023

    @Olina-Zhang
    MemberAuthor

    @Olina-Zhang, can you see which preview in 8.0 introduced this? or better yet, which PR?

    Verified that it also repro in .Net 8.0 Preview1. But verified PR met some issue: Some earlier PRs, build failures.
    image

  4. merriemcgaw commented on Apr 25, 2023

    @merriemcgaw
    Contributor

    @dreddy-work this is probably something we need to see what CSWin32 might have impacted. There's a suspicious looking one about Convert Cursor PInvokes to CSWin32. Let's get this on the backlog, but it's not a drop everything kind of issue 😄 .

  5. removed
    untriaged
    on Apr 25, 2023
  6. added this to the .NET 8.0 milestone on Apr 25, 2023
  7. dreddy-work commented on May 5, 2023

    @dreddy-work
    Member

    @Olina-Zhang, what kind of compile issues you see? can you share details? may be on Teams.

  8. Olina-Zhang commented on May 6, 2023

    @Olina-Zhang
    MemberAuthor

    @dreddy-work I corrected a PR build result about commit "984e8ec2", it was built successfully, and for previous PRs from commit "bc73fc27", they are built failed with following error info:

    image

  9. merriemcgaw commented on Jul 27, 2023

    @merriemcgaw
    Contributor

    @dreddy-work getting this one back on your radar as a .NET 8 regression

  10. JeremyKuhne commented on Aug 15, 2023

    @JeremyKuhne
    Member

    It's probably most efficient to just test the CursorEditor.CursorUI directly to see what its behavior is. Creating an instance and invoking Start with a stubbed out IWindowsFormsEditorService is all you need to do before using it in a Form as a standard ListBox.

  11. modified the milestones: .NET 8.0, 8.0 RC2 on Aug 15, 2023
  12. 7 remaining items

  13. added
    💥 regression-framework
    and removed
    💥 regression-release
    on Aug 27, 2025
  14. LeafShi1 commented on Aug 27, 2025

    @LeafShi1
    Member

    Cursor scaling is also incorrect in .net7.0,the width of the icon when it is drawn is hardcoded

    e.Graphics.FillRectangle(SystemBrushes.Control, new Rectangle(e.Bounds.X + 2, e.Bounds.Y + 2, 32, e.Bounds.Height - 4));

    The drawing logic on Net Framework is as follows:

    var cursorWidth = primaryToCurrentFactor != 1.0 ? DpiHelper.ConvertToGivenDpiPixel(cursor.Size.Width, primaryToCurrentFactor) : cursor.Size.Width

  15. self-assigned this
    on Aug 28, 2025
  16. added
    🚧 work in progress
    on Aug 28, 2025
  17. added a commit that references this issue on Sep 9, 2025
    f7f1e07
  18. locked and limited conversation to collaborators on Oct 9, 2025
  19. modified the milestones: .NET 10.0, .NET 11 on Nov 6, 2025
  20. unlocked this conversation on Dec 11, 2025
  21. Zheng-Li01 commented on Dec 11, 2025

    @Zheng-Li01
    Member

    Verified the issue with .NET SDK 11.0.100-alpha.1.25609.108, the issue has been fixed that the Cursor scaled well for now in propertyGrid for now, but Application crashes when resizing the Cursor editor in PropertyGrid, Filed GH RT issue 14122 to track

    Video.Project.mp4
  22. locked and limited conversation to collaborators on Jan 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

💥 regression-framework🚧 work in progressarea-HDPI

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions