Quantcast
Viewing all articles
Browse latest Browse all 18858

Shadow effect on Border with Text

Hi,

I am trying to create an outer shadow around the Border control.  The Border has a TextBlock inside it which displays the Welcome message for the current user.  I have two problems here, one is that when shadow is applied to border it also apply to the textbox's text - I only want for the border lines.  The other problem is that I can't find flexible way of creating outer shadow.  Can anyone provide some suggestion please: 

Here is my code:

<Grid DockPanel.Dock="Top"><Image Width="750" 
                Source="Logo.gif"   
            /><Border HorizontalAlignment="Left" VerticalAlignment="Top"
                Style="{StaticResource WelcomeUserBorder}"><TextBlock FontWeight="Bold" Padding="5"
                Text="{Binding WelcomeUser}" 
            /></Border></Grid><Style x:Key="WelcomeUserBorder" TargetType="{x:Type Border}"><Setter Property="BorderThickness" Value="3" /><Setter Property="CornerRadius" Value="15" /><Setter Property="MaxHeight" Value="30" /><Setter Property="MaxWidth" Value="300" /><Setter Property="BorderBrush" Value="Black" /><Setter Property="Effect"><Setter.Value><DropShadowEffect Color="Gray" ShadowDepth="1" /></Setter.Value></Setter></Style>

Thanks

Viewing all articles
Browse latest Browse all 18858

Trending Articles



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