dotnet / dotnet/wpf

Inconsistent visual for Wpf grid showing black line on right depending on size

Open
#9,816 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

### Description

I have a simple WPF app with a grid showing textblocks and textboxes.

If the textblock is a certain length, the window shows a black vertical bar on the right.
Adding one character to the textblock eliminates the black bar.

Here is the Xaml code for the window. If you add one character or remove one character from the textblock, the line on the right goes away.

I have screen shots of the window below.

```xaml

















```

This window shows a black bar on the right
![Screenshot 2024-09-19 161056](https://github.com/user-attachments/assets/38e2b2fe-7cc0-453a-8910-3389edc15c01)

This window does not show the bar. The only difference is the text length.
![Screenshot 2024-09-19 161138](https://github.com/user-attachments/assets/a61ce387-c930-417b-add8-abe95a2074de)

### Reproduction Steps

Use this code in a WPF Xaml window:

```xaml

















```

### Expected behavior

It should not show the black vertical bar on the right side of the window.

### Actual behavior

It is showing a vertical black bar on the right side of the window.

### Regression?

I have tried .NET 4.8, .NET 7 and .NET 8. All produce the same problem.

### Known Workarounds

_No response_

### Impact

_No response_

### Configuration

.NET 8, C#, Windows 11 Pro x64

### Other information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.