WPFでトグルボタンを作成しました。各状態は画像で表されます。 それは以下のようになります。トグルボタンの状態に応じてツールチップを配置する方法、WPF
<ToggleButton Click="ButtonEnable_Click" x:Name="ButtonEnable" Width="36" Height="36" ToolTipService.ShowOnDisabled="true" >
<ToggleButton.Resources>
<BitmapImage x:Key="imgNormal" UriSource="/Project;component/Resources/images/Image-active.png"/>
<BitmapImage x:Key="imgChecked" UriSource="/Project;component/Resources/images/Image-inactive.png"/>
</ToggleButton.Resources>
<ToggleButton.Style>
<Style TargetType="ToggleButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Image x:Name="PART_Image" Source="{StaticResource imgNormal}"/>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="PART_Image" Property="Source" Value="{StaticResource imgChecked}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter TargetName="PART_Image" Property="Source" Value="{StaticResource imgNormal}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ToggleButton.Style>
</ToggleButton>
そして、すべてが正常に動作します。 しかし、トグルボタンの状態ごとにツールチップを作成したいと思います。 「アクティブ、blabla」の1つ。 もう1つの「不活発なblabla」。 私のソフトウェアはローカライズされていなければならないので、ヒントのテキストはリソース(en、fr、deなど)に基づいています。
私が見たものから、私はそれは、単純なキーワードや何かかなり確信している...しかし、私はどのようなキーワード、と私はそれを置くために持ってどこかわからない...
どうもありがとうございました。 さようなら。
ありがとう、それは完全に働いた:)。 – Ahonir
@Ahonirあなたの歓迎:) –