Advertisement
Guest User

WPF Drop shadow effect example

a guest
Mar 28th, 2012
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.72 KB | None | 0 0
  1. using System;
  2. using System.Windows;
  3. using System.Windows.Controls;
  4. using System.Windows.Media;
  5. using System.Windows.Media.Effects;
  6.  
  7. namespace EffectsWPF
  8. {
  9.     class Program
  10.     {
  11.         [STAThread]
  12.         public static void Main()
  13.         {
  14.             var window = new Window();
  15.             var viewbox = new Viewbox();
  16.             var text = new TextBlock();
  17.             var effect = new DropShadowEffect();
  18.             effect.BlurRadius = 1;
  19.             text.Foreground = Brushes.DeepSkyBlue;
  20.             text.Text = "Hello, world!";
  21.             text.Effect = effect;
  22.             viewbox.Child = text;
  23.             window.Content = viewbox;
  24.             new Application().Run(window);
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement