One-sided rounded buttons in Silverlight

Posted by xarzu on Stack Overflow See other posts from Stack Overflow or by xarzu
Published on 2011-06-24T23:35:35Z Indexed on 2011/06/25 0:23 UTC
Read the original article Hit count: 295

I want to make a collection of buttons in silverlight. They are in a collection that goes from left to right and the buttons are lined up so that they are touching on the left and right sides. Here is the rub: The collection has rounded corners but the buttons in between the end buttons in the collection do not have rounded ends. So basically, for the buttons on the far left and right side of the collection, they have to be somewhat special because they have to have one flat vertical side and one rounded side. Is this possible to do in silverlight without resorting to making a special bitmap for the end buttons?

One idea I have is somehow declare a canvas with a bitmap background and then have overlapping ellipse and rectangle

        <Canvas Height="100" HorizontalAlignment="Left" Margin="189,381,0,0" VerticalAlignment="Top" Width="200" Background="Black">
            <Rectangle Fill="#FFF4F4F5" HorizontalAlignment="Left"  Stroke="Black" Width="58" Height="61" Canvas.Left="7" Canvas.Top="16" />
            <Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left"  Stroke="White" Width="65" StrokeThickness="0" Height="59" Canvas.Left="31" Canvas.Top="17" />
        </Canvas> 

© Stack Overflow or respective owner

Related posts about c#

Related posts about Silverlight