How to Set the Background Color of a Button without a Gradient Effect in Silverlight 4
I would like to set the background color of a Button as a solid color without any gradient effect, but am unable to do so.
The xaml that I have included is giving me an appearance like in diagram 1, even though I am chosing a solid color brush.
I would like it to appear as in diagram 2.
I would appreciate advice on how to achieve this.
I must say that I also didn't expect it... I was thinking that it in WPF it will look like what you want (no gradient) then it should look the same in Silverlight.
Since you are using Silverlight then it means that you can change the style and template of how things look. For example:
This is perfect!
I was just going to ask you a way of doing it so that I do not have to do it for every button and you have given me the answer yourself. It was very helpful. Many thanks.
Hi...
Btw, since we forced a new Template, then you will not see Mouse Over and Mouse Down effects
(The button will look like it is not being clicked).
This can also get "fixed" by Triggers, so if you need help with that then let me know.
Microsoft Development
Most development for the Microsoft platform is done utilizing the technologies supported by the.NET framework. Other development is done using Visual Basic for Applications (VBA) for programs like Access, Excel, Word and Outlook, with PowerShell for scripting, or with SQL for large databases.
Since you are using Silverlight then it means that you can change the style and template of how things look. For example:
<Button Grid.Row="1" Grid.Column="1" Content="Hello" Background="LightGreen">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBindi
<ContentPresenter HorizontalAlignment="{Temp
</Border>
</ControlTemplate>
</Button.Template>
</Button>