Live Chat Icon For mobile
Live Chat Icon

How do I change the shape of the button to an ellipse?

Platform: WPF| Category: Buttons

The button’s shape can be changed to any shape by applying the control template to a button. The following code snippet is used to change the shape of a button to an ellipse.


<ControlTemplate x:Key='Temp1' TargetType='{x:Type Button}'>
<Ellipse x:Name='Ell' Width='{TemplateBinding Width}' Height='50'>
            <LinearGradientBrush StartPoint='0,0.5' EndPoint='1,0.5'>
            <GradientStop Offset='0.3' Color='YellowGreen'/>
            <GradientStop Offset='1' Color='Green'/>
<ContentControl Margin='10' Content='{TemplateBinding Content}' FontSize='11' HorizontalContentAlignment='Center' Foreground='AntiqueWhite'/>

<Button Name='Button1' Template='{StaticResource Temp1}'  Height='50' Width='80'>Templated Button</Button>

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.