2009-12-03 3 views
2

Comment afficher rapidement l'info-bulle dans l'affichage de code suivant?Comment puis-je faire apparaître une info-bulle WPF plus rapidement avec ToolTipService.Duration?

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); 
     } 
    } 
} 

Répondre

10
ToolTipService.SetInitialShowDelay(tb, 10);