Skip to main content
Home Forums Silverlight Programming Silverlight Controls and Silverlight Toolkit How can i implement the Button "down" style always?
4 replies. Latest Post by sladapter on October 9, 2008.
(0)
spiderma...
Member
225 points
282 Posts
10-07-2008 1:15 AM |
Hi, all
like the winform's button FlatStyle property.
I want to set the button always down, like
Button.FlatStyle = FlatStyle.Flat;
How can i implement it?
murtaza....
Participant
1659 points
378 Posts
10-07-2008 4:23 AM |
YOu can modify the buttons Content Template to a style which gives some thing to windows Flat style Button.
Amanda W...
All-Star
17241 points
1,466 Posts
10-09-2008 3:36 AM |
Hi,
Try to refer the below code:
<Button x:Name="btn" Content="button" > <Button.Template> <ControlTemplate> <Grid x:Name="RootElement"> <Rectangle x:Name="BodyElement" Width="200" Height="100" Fill="Lavender" Stroke="Purple" /> <TextBlock Text="Click Me" HorizontalAlignment="Center" VerticalAlignment="Center" /> </Grid> </ControlTemplate> </Button.Template> </Button>
surbhiydv
1134 points
218 Posts
10-09-2008 6:39 AM |
Hi
To set the button style in pressed state always, just copy the vsm style storyboard for pressed visual state and paste it as it is in vsm style storyboard for normal visual state
hope this will help you
(Please 'Mark as Answer'..........if it helps you)
sladapter
17439 points
3,172 Posts
10-09-2008 10:03 AM |
You can use ToggleButton and define your own Checked state in the Template(if you do not want use the default template). With ToggleButton, one click should change it to checked state, 2nd click should made it back to normal. If you want it to stay at checked state, just set Checked=true.