Reputation: 45
I am using a tooltip on a listbox and although it works it keeps flickering/blinking any idea's how to fix this? The only thing i could think of was turning on double buffering but that didn't work.
this is the function i use;
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());
}
}
}
Thanks in advance, Robin
Upvotes: 1
Views: 3667
Reputation: 786
you can also solve this by just adding tt.toolTip.Hide(dataGridCurrAlarms); tt.toolTip.RemoveAll(); at the beginning of the method
Upvotes: 1
Reputation: 30518
Using onMouseHover instead should resolve the issue as it will not be triggered as often but still provide the same functionality.
Upvotes: 3