· Open Visual Studio 2008
· Select Windows WPF Application Template
· It will open new empty widow
· Click on ‘Window.xaml’ file
· Write below given code between the <window> .. .. .. </window> tag
<Window.Background>
<LinearGradientBrush>
<GradientStop Color="Violet" Offset="0.9"/>
<GradientStop Color="red" Offset="0.1"/>
<GradientStop Color="Yellow" Offset="0.5"/>
<GradientStop Color="Pink" Offset="0.99"/>
</LinearGradientBrush>
</Window.Background>
· Now execute the program..
· The output will be shown as above..
· Now change the code between the as below
<Window.Background>
<RadialGradientBrush>
<GradientStop Color="blue" Offset="0.2"/>
<GradientStop Color="Yellow" Offset="0.6"/>
<GradientStop Color="Orange" Offset="0.8"/>
</RadialGradientBrush
</Window.Background>
· Now again execute the program..
· It will be shown below window