读书人

listbox行,该怎么处理

发布时间: 2012-08-08 14:32:45 作者: rapoo

listbox行
listbox是示copy了哪文件日期等,有此文件名太了,而我的listbox度不,就有些信息示不出
所以如何在Items超度就超度的信息行示啊?

[解决办法]
用Tooltip行吗?

增加个tooltip控件,然后再ListBox的鼠标Hover时间里写下下面的代码


string strTip = "";

//Get the item
int nIdx = listBox1.IndexFromPoint(e.Location);
if ((nIdx >= 0) && (nIdx < listBox1.Items.Count))
strTip = listBox1.Items[nIdx].ToString();

toolTip1.SetToolTip(listBox1, strTip);

这里有实例
http://download.csdn.net/source/1614

读书人网 >C#

热点推荐