Winforms TreeView with OwnerDrawText: "DrawDefault=true" partially obscures/paints over checkboxes

138 views Asked by At

I started playing with the example code from Microsoft's doc page on Winforms TreeView.DrawNode event: https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.treeview.drawnode?view=windowsdesktop-5.0

If I comment out everything in myTreeView_DrawNode() and replace it with e.DrawDefault = true;, the CheckBoxes on the TreeView are ruined. Their rightmost pixel is overwritten.

Left side is stock TreeView with no owner drawing. Right side is as described above.

enter image description here

Is .DrawDefault hopelessly broken, or is this user error on my part?

0

There are 0 answers