The WPF program touches the edge of a transparent background window in the surface pro 9 windows 11 operating system causing the window to lose its transparent effect

whuuan 0 Reputation points
2024-07-29T05:20:21.6933333+00:00

Under the Surface pro 9 windows 11 Professional operating system, when the touch screen touches the edge of the WPF transparent background window, the transparent window will turn into a "cloud white" color, and the transparent effect will be lost, and it is difficult to recover, as shown in the following figure:

Effect when the form is transparent:

图片1

When the touch screen touches the edge of the form, the transparent window changes to "cloud white" color

图片2

Operating system version at the time of the problem

图片3

What we know so far is as follows:

  1. The form is developed using WPF.NET framework 4.6.1. Due to demand, the window background must be set to transparent, but the controls above the form are not transparent.
  2. It has been determined that touching the edge of the form causes the problem, and the problem triggered by touching the right side and bottom side of the form will disappear with stopping the touch, while the problem triggered by touching the left side and top side of the form will not disappear except restarting the application.
  3. We tried to solve the problem by setting NonClientFrameEdges to set the window edges as non-operable areas, and found that with some effect, the problem would not be triggered by setting the window edges as non-operable areas. However, NonClientFrameEdges can only be set up to a maximum of three edges, and the transparent form achieved by this method leaves blank space around the screen when it is full-screen, and cannot cover the entire screen.
  4. After communicating with the official, the current conclusion is that the different phenomena produced on different systems are the differences in design, and this kind of effect is by design on win11. There is no relevant setting to change from the system point of view, and it can only be solved from the API development aspect.

 

The program runs to create a full-screen window. On a touch screen, and in windows 11, tap the edge of the screen to turn the transparent background "white."

 

https://github.com/whuuan00/whuuan.git

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,784 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,898 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.