16,552
社区成员
发帖
与我相关
我的任务
分享
<Style TargetType="Button" x:Key="TB">
<Setter Property="Height" Value="64"/>
<Setter Property="Width" Value="64"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<StackPanel>
<Image Source="F:\mydoc\d.jpg" Width="32" Height="32" x:Name="myImage"/>
<TextBlock Text="樱桃小丸子" HorizontalAlignment="Center" x:Name="myTextBlock"/>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
NewButton.Template.FindName("myImage", NewButton).Source = MyImageSource
NewButton.Template.FindName("myTextBlock", NewButton).Text = ShowText