在windows.resource中使用下一代碼塊。樣式中的Stackpanel
<Style TargetType="Button" x:Key="l1" >
<Setter Property="Button.Effect" >
<!--<Setter Property="BitmapEffect">-->
<Setter.Value>
<DropShadowEffect />
</Setter.Value>
</Setter>
<Setter Property="Content" >
<Setter.Value >
<StackPanel Orientation="Horizontal">
<Image Source="Resources\find.bmp" Stretch="Uniform" ></Image>
<TextBlock>Find</TextBlock>
</StackPanel>
</Setter.Value>
</Setter>
</Style>
它僅適用於一個按鈕,但只要我在運行時它APLY到第二個按鈕的錯誤發生。
<Button Height="23" HorizontalAlignment="Left" Margin="322,25,0,0" Name="Button18" VerticalAlignment="Top" Width="75" Style="{StaticResource l1}" />
<Button Height="23" HorizontalAlignment="Left" Margin="586,37,0,0" Name="Button19" VerticalAlignment="Top" Width="75" Style="{StaticResource l1}" />
解決此問題的任何解決方案?
什麼錯誤,你實際上得到? –