2012-03-14 59 views
1

我使用一個列表框工具提示,雖然它的工作原理是不斷閃爍/閃爍任何想法是如何解決這一問題? 我能想到的是打開雙緩衝,但沒有工作的唯一的事情。閃爍工具提示

這是我使用的功能;

private void onMouseMove(object sender, MouseEventArgs e) 
{ 
    if (sender is ListBox) 
    { 
     Point point = new Point(e.X, e.Y); 
     int hoverIndex = LSB_OfflineVars.IndexFromPoint(point); 
     if (hoverIndex >= 0 && hoverIndex < LSB_OfflineVars.Items.Count) 
     { 
      tt.SetToolTip(LSB_OfflineVars, LSB_OfflineVars.Items[hoverIndex].ToString()); 
     } 
    } 
} 

由於提前, 羅賓

+0

相關的代碼丟失,所以我們不能真正幫助的開始,只是猜測。什麼是'LSB_OfflineVars'?什麼是'SetToolTip'方法的代碼? – 2012-03-14 15:06:49

+0

你爲什麼'幫助'tt提供者? – 2012-03-14 15:08:04

+1

@shadow - 它實際上相當完整和易於理解。 – 2012-03-14 15:11:07

回答

2

使用onMouseHover而應該解決的問題,因爲它不會被經常觸發,但仍然提供相同的功能。

+0

感謝所有這回應了這個伎倆。 – 2012-03-14 15:32:56

1

你也可以僅僅通過增加 tt.toolTip.Hide(dataGridCurrAlarms)解決這個問題; tt.toolTip.RemoveAll(); 在方法