dotnet / dotnet/wpf

IsHitTestVisible property doesn't work on a Window object.

Open
#7,474 2 comments 0 reactions 0 assignees View on GitHub
Investigate
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

* .NET Core Version: 7.0.2
* Windows version: 22H2 25284.1000
* Does the bug reproduce also in WPF for .NET Framework 4.8?: Why? I'm using .NET 6.

**Problem description:**
IsHitTestVisible is a property on a WPF Window type, but doesn't seem to do much to the window. As mentioned in https://github.com/dotnet/wpf/issues/3088 - it's expected to just work, while the window itself can still be clicked. Internally the property on a Window should set the WS_EX_TRANSPARENT style on the backing HWND.

**Actual behavior:**
Setting IsHitTestVisible="False" on a Window doesn't make the window "click-through"

**Expected behavior:**
A Window with IsHitTestVisible="False" should allow users to click elements behind that window to enable scenarios like a custom system-wide tooltip that doesn't belong to any window.

**Minimal repro:**

```

myWindow.Show();
```

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.