I've been attempting to create a customized plus button in WPF. I only want the + symbol but I'm not having any luck getting the Path data variables just right. I've looked at the Path syntax but I'm still having trouble.
This is what I have so far, but it is too big. I need a smaller, more proportional button:
<Path
Stretch="Fill"
Opacity="1"
x:Name="path"
StrokeThickness="10"
RenderTransformOrigin="0.5,0.5" Margin="39,56.75,39,65.25" Data="M0,5L10,5 M5,5L5,1z" >
Can anyone tell me what I've got wrong here?
Thanks
You can use the Data
property like this
<Button>
<Path Data="M0.5,0 L0.5,1 M0,0.5 L1,0.5"
StrokeThickness="4"
Stretch="Fill"
Stroke="Red" />
</Button>
Looks like this
Edit
If you want the line caps to reach the edges of the Button
you can set
StrokeEndLineCap="Square"
StrokeStartLineCap="Square"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With