dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.29k stars 956 forks source link

Column Borders Misalignment and Top Row Header Border Disappearance with RightToLeft and VisualStyles not Enabled #11431

Closed ricardobossan closed 1 month ago

ricardobossan commented 1 month ago

.NET version

9.0.100-preview.3.24204.13

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

During the review of PR 11345, we identified two issues when RightToLeft is set to Yes and VisualStyles is not enabled:

  1. Column borders misalignment between header and body;
  2. The top row header's left border disappears when there's a horizontal scrollbar and it is moved to the left.

Screenshots:

In all images:

1. Column borders misalignment between header and body

The problem only happens on RTL and when VisualStyles is not enabled:

100% Zoom:

misaligned_visualstyles_off_zoom_100

400 Zoom:

misaligned_visualstyles_off_zoom_400

2. The top row header's left border disappears when there's a horizontal scrollbar and it is moved to the left

The problem only happens on RTL and when VisualStyles is not enabled.

disapearing_border_on_scroll

3. Also, @Olina-Zhang noticed gaps between row and column lines in the headers and row headers when VisualStyles is not enabled

@Tanya-Solyanik , I don't know if this problem should be addressed in this issue because:

100% Zoom:

visualstyles_off_zoom_100

400% Zoom:

visualstyles_off_zoom_400

These issues are not regressions from PR 11345. We are opening this new issue to track the column borders misalignment and the top row header border issue.

We will investigate these problems further and work towards a resolution in this new issue.

Steps to reproduce

Create a new DataGridView form and set it to RightToLeft.Yes and do not enable VisualStyles. Sample project here.

merriemcgaw commented 1 month ago

We should not be making changes to anything with Visual Styles turned off.