我有listview
對象,並有幾列。其中一列不適合所有文本信息,並且文本已被剪切。我需要實現這樣的事情:當用戶將鼠標光標移動到該列的單元格時,會顯示所有文本。有可能這樣做嗎? 現在我有:當光標在ListView單元格上時如何顯示工具提示?
protected ListViewItem GetItem(ListView listView, Point mousePosition)
{
Point localPoint = listView.PointToClient(mousePosition);
return listView.GetItemAt(localPoint.X, localPoint.Y);
}
private void myListView_MouseMove(object sender, MouseEventArgs e)
{
ListViewItem item = GetItem(myListView, Cursor.Position);
// or should I use e.Location instead of Cursor.Position?
item.ToolTipText = "my info"//Now I need to show "my info" on the cell
//that user move cursor on
}
我不需要添加新項目 –