要實現在Button里面加入圖標或者圖形以及文字,我們就需要在Button里面用一個WrapPanel控件,這個WrapPanel控件會把我們的圖標或者文字進行包裹,並顯示出來。
Xaml:
<Button HorizontalAlignment="Left" Margin="222,151,0,0" VerticalAlignment="Top" Width="259" Height="52">
<WrapPanel Height="52" Width="259">
<Image Height="52" Width="61" Source="Resources/數據管理.png"/>
<TextBlock TextWrapping="Wrap" Text="數據管理" Width="197" FontSize="22" VerticalAlignment="Center" Padding="40,0,0,0"/>
</WrapPanel>
</Button>
這里面Image的Source是需要你自己添加的圖像資源,怎樣引入外部的圖像資源?看看這個 https://www.cnblogs.com/Leozi/p/10777780.html
效果圖 :

