How to revert the transparent window of WPF.

Sunil A M 171 Reputation points

HI Team,

I have used a below technique to create a transparent(click thru) window in WPF.

Could you please tell me how to revert the above functionality on some event(on the fly).
(Need code to Revert the transparent window to normal window on some event).

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,667 questions
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,199 questions
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
761 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 81,461 Reputation points

    You can remove the WS_EX_TRANSPARENT extended style :

     int nExStyle = GetWindowLong(hWnd, GWL_EXSTYLE);  
     SetWindowLong(hWnd, GWL_EXSTYLE, (nExStyle & ~WS_EX_TRANSPARENT));  
    0 comments No comments

0 additional answers

Sort by: Most helpful