lukang423 2015-10-29 04:18 采纳率: 0%
浏览 1295

请教大神一条关于wpf的问题


<br> <Setter Property="Template"><br> <Setter.Value><br> <ControlTemplate TargetType="Button"><br> <Grid Width="50" Height="60"><br> <Grid.RowDefinitions><br> <RowDefinition Height="3*"/><br> <RowDefinition Height="*"/><br> </Grid.RowDefinitions><br> <Image Grid.Row="0" Name="image"/><br> <Label Grid.Row="1"/><br> </Grid><br> </ControlTemplate><br> </Setter.Value><br> </Setter><br>

我写了这样的一段代码,就是想用ContentControl来改变Button的外观,我定义好几个Button,都是采用这种样式(上面是图片,下面是文字),但是我每个Button的图片和文字都不相同,然后我在xaml里定义Button的时候就遇到问题了,怎么为我定义的这种样式的按钮添加图片和文字?求大神指教

  • 写回答

1条回答 默认 最新

  • lukang423 2015-10-29 04:19
    关注


    <br> <Setter Property="Template"><br> <Setter.Value><br> <ControlTemplate TargetType="Button"><br> <Grid Width="50" Height="60"><br> <Grid.RowDefinitions><br> <RowDefinition Height="3*"/><br> <RowDefinition Height="*"/><br> </Grid.RowDefinitions><br> <Image Grid.Row="0" Name="image"/><br> <Label Grid.Row="1"/><br> </Grid><br> </ControlTemplate><br> </Setter.Value><br> </Setter><br>

    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?