c# - 如何使用 ToolTipService.Duration 使 WPF ToolTip 显示得更快?

标签 c# wpf xaml tooltip

如何让下面代码中的Tooltip显示得更快?

using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;

namespace TestHover29282
{
    public partial class Window1 : Window
    {
        public Window1()
        {
            InitializeComponent();

            TextBlock tb = new TextBlock();
            tb.Text = "Jim Smith";

            ToolTip tt = new ToolTip();
            tt.Content = "This is some info on the customer.";

            tb.ToolTip = tt;

            //ToolTipService tts = new ToolTipService();
            //tts.Duration = 0;
            //tb.ToolTipService = tts;

            MainStackPanel.Children.Add(tb); 
        }
    }
}

最佳答案

ToolTipService.SetInitialShowDelay(tb, 10);

关于c# - 如何使用 ToolTipService.Duration 使 WPF ToolTip 显示得更快?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1841956/

相关文章:

c# - FileUpload 和 UpdatePanel : ScriptManager. RegisterPostBackControl 第二次工作

c# - 如何覆盖 ToString() 方法以输出列表?

c# - nuget : .net core中的打包项目引用

c# - 带有图标的 Xamarin.Forms 列表应用程序(仅限 Android)

c# - WPF 数据绑定(bind) : database or objects?

c# - 带有 CheckBox 数据模板的 WPF ListBox - Checkbox 的绑定(bind)内容属性不起作用

c# - 在 WPF 中将焦点设置在文本框上

wpf - Gridsplitter 忽略列的最小宽度

c# - ContentPresenter 的异常行为

.net - XAML 中的程序集别名