mouse scroll operation
i have a listviewitem where list of items are there: like
AAA
BBB
CCC
by default on form load first item (AAA) is selected (focused). Now, when i scroll down the mouse i want the focus should go to second item(BBB), again i scroll down mouse i want the focus should go to the third item(CCC). And when i scroll up focus should come from the last item to the first item one by one. how to do this. i dont think any scroll event is there in mouse operation. i ma using windows application with C#. please help me if you guys can.
regards,
bhargob
b bPosted Sep 15, 2009, 3:24 AM
lohith bandrehalliPosted Sep 4, 2009, 3:48 AM
private void listView1_MouseMove(object sender, MouseEventArgs e)
{
ListViewItem item = listView1.GetItemAt(e.X, e.Y);
this.listView1.MultiSelect = false;
if(item != null)
{
if(item.Selected == false)
{
item.Selected = true;
}
else
{
item.Selected = false;
}
}
}
b bPosted Sep 4, 2009, 2:08 AM
lohith bandrehalliPosted Sep 4, 2009, 1:28 AM
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/c1ae88c0-53c1-47d6-b31b-f7200b1bfa14