Reputation: 966
Using C# I create a window whose border is normal, but the client area is transparent (using the transparency key). On XP I was able to click through this (accessing the items below the transparent area); however, this doesn't work on W7. Is there a way to make this work for W7 (and XP)?
UPDATE: Thanks to all for the quick responses! Looks like the key to my problem was the unlucky fact that I happened to use YELLOW as my transparency key. I wanted it to stand out in Visual Studio so that I would remember that it was transparent; and that color choice is what was keeping click-through from working. As soon as I changed to a backcolor that was gray, it worked fine.
Upvotes: 3
Views: 765
Reputation: 3915
According to this post, the workaround is to set the TransparencyKey to Gray
this.BackColor = Color.Gray;
this.button1.BackColor = Color.Blue;
this.TransparencyKey = Color.Gray;
Upvotes: 2
Reputation: 157
this.TransparencyKey = this.BackColor;
This works fine for me in Windows 7.
Upvotes: 0