Page view counter
How can i implement the Button "down" style always? Subscribe to this thread
Last post 10-09-2008 10:03 AM by sladapter. 4 replies.
Sort Posts:
10-07-2008 1:15 AM
How can i implement the Button "down" style always?

 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?

spiderman110

Loading...
Joined on 09-10-2008
Posts 211
10-07-2008 4:23 AM
Re: How can i implement the Button "down" style always?

 YOu can modify the buttons Content Template to a style which gives some thing to windows Flat style Button.

Murtaza Dharwala
Diaspark Inc.
www.diaspark.com
email:murtaza.dharwala@diaspark.com


Please remember to click “Mark as Answer” on the post that helps you

murtaza.dharwala

Loading...
Joined on 09-25-2008
Posts 378
10-09-2008 3:36 AM
Re: How can i implement the Button "down" style always?

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>

Amanda Wang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Amanda Wang - MSFT

Loading...
Joined on 04-30-2007
Posts 1,015
10-09-2008 6:39 AM
Re: How can i implement the Button "down" style always?

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)

surbhiydv

Loading...
Joined on 08-18-2008
India
Posts 218
10-09-2008 10:03 AM
Marked as Answer
Re: How can i implement the Button "down" style always?

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.

sladapter
Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

sladapter

Loading...
Joined on 03-05-2008
Indiana, US
Posts 2,861
Microsoft Communities