Good morning, I'm not quite sure if I'm in the right place with this question, if not please let me know.
I'm just starting out with WPF and have already hit my first hurdle.
I would like to set a colour gradient as the button background. I've managed it for simple rectangles, but somehow it doesn't work for buttons... Can anyone help me?
The following code works for rectangles
Thanks a lot, Philipp
I'm just starting out with WPF and have already hit my first hurdle.
I would like to set a colour gradient as the button background. I've managed it for simple rectangles, but somehow it doesn't work for buttons... Can anyone help me?
The following code works for rectangles
C#:
<Rectangle>
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="Yellow" Offset="0.0" />
<GradientStop Color="Red" Offset="0.25" />
<GradientStop Color="Blue" Offset="0.75" />
<GradientStop Color="LimeGreen" Offset="1.0" />
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
Thanks a lot, Philipp