I have listview object, and several columns in it. One of the columns does not fit all text info, and the text has been cutted. I need to implement something like this: when user move mouse cursor to this column’s cell, all the text is shown. Is it possible to do that ?
Now i have:
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
}
One of the old ways to show decent tooltip with lists is to hide a label and make it visible at the desired location, with the desired text for the desired duration. Benefit of this could be multi-line, multi-color tip.
So it works like this:
size and show your label filled with data.
is visible and make it invisible in 5 seconds, for example.
I remember doing just that this year. Although my “tooltip” was done over the listbox.
Replace label with a textbox and suddenly you can make your data in the cell editable :o)