dotnet / dotnet/winforms

PictureBox Background Transparency over any control

Open
#6,742 3 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
1d 13m
Merged PRs (30d)
85

Description

* .NET Core Version:
.NET SDK 7.0.100-preview.2.22103

* Have you experienced this same bug with .NET Framework?:
Yes

**Problem description:**
It is from a suggestion ticket: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1469120
I have a PictureBox filled with a .png image (image with Transparent background) and I place this PictureBox over a ListBox and the result is not what I expected. The PictureBox still shows it’s own background or the Forms’s background, it doesn’t allow me to see through the PictureBox, since my image has a transparent background.
![image](https://user-images.githubusercontent.com/62929087/155270205-86013602-7437-401a-bd39-bcac2c961bd6.png)

**Expected behavior:**
The PictureBox should allow customer to see through the PictureBox, since the image has a transparent background.

**Minimal repro:**
1. Create a winforms .net core project with a pictureBox control added.
2. Click the "Choose Image.." link in SmartTag of PictureBox to add a transparent image to it.
3. Add a ListBox to the form designer, then put PictureBox over this ListBox.
4. Build and run this project.

Or

1. Extract and open following test app:
[TestApp.zip](https://github.com/dotnet/winforms/files/8122281/TestApp.zip)
2. Build and run this project

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.