转自:http://blog.csdn.net/webkis/article/details/5977399
1 <Window x:Class="MyWPF.MainWindow" 2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 3 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 4 Title="DownLoad Demo" Height="350" Width="525" Loaded="Window_Loaded"> 5 <Window.Background> 6 <LinearGradientBrush> 7 <GradientStop Color="Red" Offset="0"></GradientStop> 8 <GradientStop Color="Yellow" Offset="0.5"></GradientStop> 9 </LinearGradientBrush> 10 </Window.Background> 11 <Grid> 12 <Label x:Name="txtWords"></Label> 13 <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom"> 14 <Button Content="start download" Width="120" Height="23" Margin="8" Click="Button_Click"> 15 <Button.Effect> 16 <DropShadowEffect Color="Blue" BlurRadius="1"></DropShadowEffect> 17 </Button.Effect> 18 </Button> 19 <Button Content="cancel" Width="70" Height="23" Margin="8" Click="Button_Click_1"> 20 <Button.Effect> 21 <DropShadowEffect Color="Blue" BlurRadius="1"></DropShadowEffect> 22 </Button.Effect> 23 </Button> 24 </StackPanel> 25 <Rectangle Width="220" Stroke="Red" StrokeThickness="2" Height="60" RadiusX="5" RadiusY="5"> 26 </Rectangle> 27 <ProgressBar x:Name="progressBar" Width="180" Height="23" /> 28 </Grid> 29 </Window>