把你的路徑視框所以它擴展到按鈕的大小。例如
<Grid>
<Button Height="23">
<Viewbox>
<Path Stroke="White" StrokeThickness="3">
<Path.Data>
<GeometryGroup>
<LineGeometry StartPoint="0,0" EndPoint="20,20" />
<LineGeometry StartPoint="20,0" EndPoint="0,20" />
</GeometryGroup>
</Path.Data>
</Path>
</Viewbox>
</Button>
</Grid>
或
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Button HorizontalContentAlignment="Left">
<StackPanel Orientation="Horizontal">
<Viewbox>
<Path StrokeEndLineCap="Triangle" StrokeStartLineCap="Triangle"
Stroke="White" StrokeThickness="3">
<Path.Data>
<GeometryGroup>
<LineGeometry StartPoint="0,0" EndPoint="20,20" />
<LineGeometry StartPoint="20,0" EndPoint="0,20" />
</GeometryGroup>
</Path.Data>
</Path>
</Viewbox>
<TextBlock Margin="5,0,0,0" VerticalAlignment="Center" Text="Press me"/>
</StackPanel>
</Button>
</Grid>
這對我的作品。你的路徑是什麼? – Phil 2012-04-09 15:50:28
@Phil我的路徑包含在一個Button內的Grid中。 – teenup 2012-04-09 17:22:08