C
C#2y ago
Exilon

Window opacity isn't being affected?

I have a button click method over here that should set a window to opaque:
private void Button_Click_2(object sender, RoutedEventArgs e)
{
if (overlay.thisOverlay != null)
{
overlay.thisOverlay.makeOpaque();
}
}
private void Button_Click_2(object sender, RoutedEventArgs e)
{
if (overlay.thisOverlay != null)
{
overlay.thisOverlay.makeOpaque();
}
}
The method works too. The trace here works:
// This function is in the "overlay" class
public void makeOpaque()
{
this.Opacity = 1;
Trace.WriteLine("Works");
}
// This function is in the "overlay" class
public void makeOpaque()
{
this.Opacity = 1;
Trace.WriteLine("Works");
}
The output shows the message but the opacity of the window doesn't change. What am I doing wrong?
10 Replies
Johnny
Johnny2y ago
Do you want to fade it out? Opacity of 1 means fully visible (to make it fade the value needs to go to 0)
Exilon
Exilon2y ago
I want it to fade but right now, I just need it to be fully opaque. Ill figure out the fade myself
Johnny
Johnny2y ago
Set this.Opacity = 1; to this.Opacity = 0;
Exilon
Exilon2y ago
Wouldn't that just make the window entirely transparent/ ? Same thing Opacity wont change :/
Johnny
Johnny2y ago
Well, I would probably need some more code
Exilon
Exilon2y ago
What would you like to see?
Johnny
Johnny2y ago
Or wait, try 0.5
Exilon
Exilon2y ago
Still the same :( What's wierder is that changing other properties work like window state its just opacity
Johnny
Johnny2y ago
hmm
Exilon
Exilon2y ago
Definitely wierd
Want results from more Discord servers?
Add your server
More Posts