FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Highlighted ListView Item and ENTER

 
Post new topic   Reply to topic     Forum Index -> DFL
View previous topic :: View next topic  
Author Message
jicman



Joined: 22 Dec 2004
Posts: 298
Location: Rochester, NY

PostPosted: Wed Dec 06, 2006 5:09 pm    Post subject: Highlighted ListView Item and ENTER Reply with quote

How can I use the ENTER key to select the highlighted ListView item? In other words, I want to also use the ENTER key as a double'click. I've searched through the documentation for the ListView Object, but didn-t see anything reflecting this option.

thanks.

josé
Back to top
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Thu Dec 07, 2006 5:32 am    Post subject: Re: Highlighted ListView Item and ENTER Reply with quote

You can use the keyDown event and check the KeyEventArgs' keyCode against Keys.ENTER and call a common "clicked" function.
Code:
mylist.keyDown ~= &mylist_keyDown;
...
   private void mylist_keyDown(Object sender, KeyEventArgs ea)
   {
      if(ea.keyCode == Keys.ENTER)
      {
         doMyListClickAction();
      }
   }
Note that an acceptButton can interfere; you could set it to null and back upon focus/lost-focus.
Back to top
View user's profile Send private message
jicman



Joined: 22 Dec 2004
Posts: 298
Location: Rochester, NY

PostPosted: Thu Dec 07, 2006 8:00 am    Post subject: Reply with quote

thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DFL All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group