Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: WPF
How should I modify my code to make the corners of my button rounded?
<UserControl x:Class="WindowsFormsApplication8.UserControl1"
    Height="154" Width="177">
        <Rectangle Name="rectangle1" Stroke="Black" RadiusX="10" RadiusY="10" >
        <Button Name="rectangle2" Foreground="Black" Margin="3,3,3,3" >
            <Button.Background >
                <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                    <GradientStop Color="Green" Offset="0.0" />
                    <GradientStop Color="White" Offset="0.9" />
What is the simplest way?
Posted 25-May-10 8:55am
Member 10771181 at 18-Jun-14 9:38am
set required background view to rectangle and keep button's background as transparent.
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

To get round edged corners, you have to use a control template.
I have explained that in my blog :[^]
Hope it helped!
Manfred R. Bihy at 28-Feb-11 4:50am
Nice example! 5+
Tarun.K.S at 28-Feb-11 5:00am
Thanks! :)
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Have a look at this article: A Style for Round Glassy WPF Buttons[^]
Manfred R. Bihy at 28-Feb-11 4:48am
Link to a great article! 4+
Sandeep Mewara at 28-Feb-11 9:16am
Thanks Manfred.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 580
1 OriginalGriff 420
2 Sascha Lefévre 289
3 Abhinav S 220
4 CHill60 200
0 Sergey Alexandrovich Kryukov 9,773
1 OriginalGriff 9,290
2 Peter Leow 5,137
3 Kornfeld Eliyahu Peter 3,373
4 Maciej Los 3,036

Advertise | Privacy | Mobile
Web04 | 2.8.150327.1 | Last Updated 28 Feb 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100