PC Review


Reply
Thread Tools Rate Thread

can't trap the action button event while moving over the items in the listview control

 
 
Asheesh
Guest
Posts: n/a
 
      11th Jul 2003
Hi All,

I'm using a listview control, in which items can be traversed up and down by
using the action button.

However, I'm not able to trap this traversal or event by the action button.

Though I'm able to use the listView.SelectedIndexChanged event, but in this
event, I'm not able to get the selected Item property..

if I use listView.SelectedIndices[0] property, it gives me a System Out of
Range exception.. MSDN advises SelectedItems property to use, but it isn't
supported by .NET CF. Is there a way where I can get to move through the
items up and down and then perform any action related to it..

This is my code snippet which gives me the error

private void lvSearch_SelectedIndexChanged(object sender, EventArgs e)
{
if((lvSearch.Items.Count > 0)&&(lvSearch.Items[0].Text!=NOTFOUNDMSG))
{
int ClickedId=lvSearch.SelectedIndices[0];
ItemId=Convert.ToInt32(lvSearch.Items[ClickedId].SubItems[1].Text);
int AudiId=Convert.ToInt32(lvSearch.Items[ClickedId].SubItems[2].Text);
DisplayPhrase(ItemId,AudiId);
}
}

Any help would be deeply appreciated..

Regards,
Asheesh


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
trap clic event from command bar button flogyu Microsoft Access VBA Modules 1 20th May 2008 12:49 PM
Trap ListView Scroll Event =?Utf-8?B?RGFpc3k=?= Microsoft Dot NET Framework Forms 0 28th Nov 2005 11:06 PM
Moving listview items Nick Microsoft VB .NET 6 15th Feb 2005 04:33 PM
ListView.ItemCheck event fires on ListView.Items.Insert =?Utf-8?B?RGV2ZWxvcGVy?= Microsoft Dot NET Framework Forms 0 14th Sep 2004 03:21 AM
How can I trap Click or MouseDown (left button) event on ScrollBar control? FU.U.NA Microsoft Dot NET Framework Forms 0 24th Mar 2004 09:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:32 PM.