Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TreeView with checkboxes and DrawDefault = true renders incorrectly #12601

Open
mario-mantese opened this issue Dec 6, 2024 · 4 comments · May be fixed by #12638
Open

TreeView with checkboxes and DrawDefault = true renders incorrectly #12601

mario-mantese opened this issue Dec 6, 2024 · 4 comments · May be fixed by #12638
Assignees
Labels
🪲 bug Product bug (most likely) 🚧 work in progress Work that is current in progress

Comments

@mario-mantese
Copy link

.NET version

net8

Did it work in .NET Framework?

Not tested/verified

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

No response

Issue description

Same issue as described in https://stackoverflow.com/q/69978042
DrawDefault=true is not rendering nodes correctly in checkboxes are present

Steps to reproduce

Create a form, add a TreevView with CheckBoxes=true and DrawMode=OwnerDrawText
In OnDrawNode event only set DrawDefault=true
Show the form: checkboxes are shown corrupted on the right border
Image

@mario-mantese mario-mantese added the untriaged The team needs to look at this issue in the next triage label Dec 6, 2024
@elachlan
Copy link
Contributor

elachlan commented Dec 8, 2024

@Olina-Zhang can your team please test?

@Olina-Zhang
Copy link
Member

Olina-Zhang commented Dec 9, 2024

@Olina-Zhang can your team please test?

This is not a regression issue, can repro in .NET framework and .NET different versions with a TreevView setting its CheckBoxes=true and DrawMode=OwnerDrawText

.NET framework 4.8.1:
Image

.NET 9.0:
Image

@elachlan elachlan added the 🪲 bug Product bug (most likely) label Dec 9, 2024
@merriemcgaw
Copy link
Member

@LeafShi1 can you see if this repros the same way in an MFC app and then we'll take a look. We should make sure we're aligned with how it behaves.

@LeafShi1
Copy link
Member

@LeafShi1 can you see if this repros the same way in an MFC app and then we'll take a look. We should make sure we're aligned with how it behaves.

In the MFC project, the treeView control does not have a corresponding DrawMode property, so how to draw text is custom. When the text position is offset, the right border of the check box will be covered, as shown below.
Image

So this should be a problem in winform. I submitted a PR for a fix.

@dotnet-policy-service dotnet-policy-service bot added the 🚧 work in progress Work that is current in progress label Dec 13, 2024
@LeafShi1 LeafShi1 removed the untriaged The team needs to look at this issue in the next triage label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Product bug (most likely) 🚧 work in progress Work that is current in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants