kryptonListBox控件,出自www.componentfactory.com的Krypton Toolkit,是一套免费的DotNet控件,同时官方提供商业版的Docking,Navigating和RIbbon。最为遵纪守法的穷人,我选择了免费的Toolkit作为开发部件,不敢使用商业版的套件。
在这个控件中有几个地方不如人意,在此备注
void ListBox_MouseMove(object sender, MouseEventArgs e)
{
ListBox objListBox = (ListBox)kryptonListBox1.ListBox ;
int itemIndex = -1;
if (objListBox.ItemHeight != 0)
{
itemIndex = e.Y/ objListBox.ItemHeight;
itemIndex += objListBox.TopIndex;
}
if ((itemIndex >= 0) && (itemIndex < kryptonListBox1.Items.Count))
{
KryptonListItem item = kryptonListBox1.Items[itemIndex] as KryptonListItem;
if (null != item)
{
toolTip1.SetToolTip(objListBox, item.ShortText);
}
}
else
{
toolTip1.Hide(objListBox);
}
}