20
ボタン上でMouseOverエフェクトを無効にしようとしているか、少なくともWPFでその色を変更しようとしています。 Window.ResourcesでWPFのボタンでMouseOverエフェクトを無効にするにはどうすればよいですか?
<Style x:Key="Borderless" TargetType="{x:Type Button}">
<Setter Property="OverridesDefaultStyle" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Button Background="{TemplateBinding Control.Background}"
Focusable="False">
<ContentPresenter
Margin="{TemplateBinding Control.Padding}"
HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}"
ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
RecognizesAccessKey="True"
Content="{TemplateBinding ContentControl.Content}" />
</Button>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
、私はすべてのデフォルトの動作をオーバーライドするだろうと思った:
私は、次のスタイルを使用しています。しかし、それはしません。
提案がありますか?
それは素晴らしいです、チャーリー。わかった。乾杯。 – jarmond
このチャーリーをありがとう、それは非常に助けてくれました。 – billb
これは私の命を救った、ありがとう。透明なボタンでレイアウトを作成しなければなりませんが、ホバー効果は私の計画を台無しにしました。 – mico