Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPF setting Background property of Label from code at runtime

$
0
0
Hello,

I have the following label in the window:

<Label Name="ProgressLabel" 
    Grid.ColumnSpan="2" FontSize="130"
    VerticalContentAlignment="Center"
    HorizontalContentAlignment="Center" Foreground="White"
    Background="Transparent" Opacity=".75" FontFamily="Calibri"
    Visibility="Hidden" />

Now, on event A I want to change Background of label from transparent to Black from code at runtime.
And on event B, I want to set Background of label back to transparent from code at runtime.

Could you please help me figure out how should I go about it?

Thank you :)

Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>