I have a ListView
with 4 items, and 3 subitems in each item.
Now, for example, I'd want to get the coordinates(position) relative to the Form
for item 2, subitem 2.
How can I do it?
I have a ListView
with 4 items, and 3 subitems in each item.
Now, for example, I'd want to get the coordinates(position) relative to the Form
for item 2, subitem 2.
How can I do it?
You are looking for Bounds
property of a ListViewSubItem
. Here is a simple usage of the property:
private void listView1_MouseDown(object sender, MouseEventArgs e)
{
var bound = listView1.Items[1].SubItems[1].Bounds;
if (e.X > bound.Left && e.X < bound.Right && e.Y > bound.Top && e.Y < bound.Bottom)
{
MessageBox.Show("hello world");
}
}