user15363261
user15363261

Reputation: 1

C# Opacity change on application change

How do i change my C# window opacity after user clicks onto another application? my application stays on topmost and i want for it to be translucent so the user can see the full page

Upvotes: 0

Views: 75

Answers (1)

Victor
Victor

Reputation: 2371

In your Form's contructor:

this.Activated += (sender, e) => this.Opacity = 1.0;
this.Deactivate += (sender, e) => 
{
   if (!this.Disposing)
      this.Opacity = 0.3
};

Upvotes: 1

Related Questions