【问题标题】:WPF Button does not show ToolTip when TapAndHold consecutively连续 TapAndHold 时 WPF 按钮不显示工具提示
【发布时间】:2015-10-02 21:01:02
【问题描述】:

我正在触摸屏桌面上实现 .NET 4.5 WPF 应用程序。在测试我的应用程序时,我意识到当我连续两次点击并按住同一个按钮时,我的按钮的工具提示不会出现。

1) 我点击并按住按钮 A 一次,按钮 A 的工具提示按预期显示。 2)我再次点击并按住按钮A(在初始工具提示消失后),工具提示将不再出现。 3)我点击并按住按钮 B,按钮 B 的工具提示出现。 4) 我现在点击并按住按钮 A,按钮 A 的工具提示现在能够出现。

我不确定这是默认行为还是我在代码中某处执行的操作导致了这种情况发生。我可以做些什么来确保工具提示每次都出现?

感谢您的帮助。

【问题讨论】:

    标签: c# wpf button tooltip


    【解决方案1】:
     </StackPanel.Resources>
            <ContentControl HorizontalAlignment="Center" VerticalAlignment="Center" >
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="MouseLeftButtonDown">
                        <MvvmLight:EventToCommand Command="{Binding MessageInfoVm.ShowInfoMessageCommand}" CommandParameter="{Binding ToolTipOk}"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
                <Button ToolTipService.ShowOnDisabled="True" ToolTip="{Binding ToolTipOk}"  Command="{Binding OkCommand}" />
            </ContentControl>
    

    尝试 ToolTipService.ShowOnDisabled="True" 或 MouseLeftButtonDown 的附加事件

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-09-25
      • 1970-01-01
      • 1970-01-01
      • 2016-07-15
      • 2011-05-08
      • 2012-08-07
      • 1970-01-01
      相关资源
      最近更新 更多