小按钮内的图标wpf

时间:2018-06-18 06:54:32

标签: wpf xaml

我正在尝试在小Button内添加图标,但它没有按照需要输入,

这是我的xaml:

<Button x:Name="eye_button"  BorderBrush="{x:Null}"   Margin="234,0,0,0"  Height="15" Width="15">                                     
        <materialDesign:PackIcon Kind="Eye"   Foreground="Black" />
  </Button>

这是它的样子:

enter image description here

左边是按钮,右边是图标

2 个答案:

答案 0 :(得分:2)

试试这个:

df <- read.table(text =
    "         Method   n    lambda     df
'10.fold.CV Lasso' 30  1.3102653 21.199
10.fold.CV.1SE   30  3.3734592 17.379
'10.fold.CV Lasso' 50  0.8956816 28.713
10.fold.CV.1SE   50  2.3527001 25.540
BIC              50  1.9833844 24.757
Modified.BIC     50  0.2091384 31.714
'10.fold.CV Lasso' 100 0.6467475 33.591
10.fold.CV.1SE   100 2.4961030 32.092", header = T)

它应该在运行时看起来像这样:

enter image description here

答案 1 :(得分:1)

 <Button
    Width="15"
    Height="15"
    Padding="0"
    HorizontalAlignment="Center"
    HorizontalContentAlignment="Center"
    VerticalContentAlignment="Center"
    Background="Transparent"
    BorderThickness="0"
    Foreground="Red">

    <materialDesign:PackIcon
        Width="15"
        Height="15"
        HorizontalAlignment="Center"
        VerticalAlignment="Center"
        Foreground="Black"
        Kind="ArrowBack" />
</Button>

确保将填充设为0

enter image description here