winform listbox 显示tooltip(防闪烁)
winform listbox 显示tooltip(防闪烁)<div class="postbody"><div id="cnblogs_post_body"><div class="cnblogs_Highlighter"><div class="cnblogs_code">private void listBox1_MouseMove(object sender, MouseEventArgs e) { int index = listBox1.IndexFromPoint(e.Location); // Check if the index is valid. if (index != -1 && index < listBox1.Items.Count) { // Check if the ToolTip's text isn't already the one // we are now processing. if (toolTip1.GetToolTip(listBox1) != listBox1.Items.ToString()) { // If it isn't, then a new item needs to be // displayed on the toolTip. Update it. toolTip1.SetToolTip(listBox1, listBox1.Items.ToString()); } } }
页:
[1]