Search code examples
c#wpfglow

Create label with the same properties as the title


Note how the letters of the title of my window glow:

enter image description here

How could I create a label with the same effect?


Solution

  • In WPF you can overlay ordinary text on text with a blur to accomplish the background glow effect.

    Here's the markup:

    <Grid Background="CadetBlue">
        <Grid Margin="20">
            <TextBlock Text="Stack Overflow" FontSize="24" FontWeight="Bold" Foreground="AliceBlue">
                <TextBlock.Effect>
                    <BlurEffect Radius="30"/>
                </TextBlock.Effect>
            </TextBlock>
            <TextBlock Text="Stack Overflow" FontSize="24" FontWeight="Bold" Foreground="Black"/>
        </Grid>
    </Grid>
    

    and this is what it looks like:

    Text Glow Effect