View previous topic :: View next topic |
Author |
Message |
jicman
Joined: 22 Dec 2004 Posts: 298 Location: Rochester, NY
|
Posted: Wed Dec 06, 2006 5:09 pm Post subject: Highlighted ListView Item and ENTER |
|
|
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 |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Thu Dec 07, 2006 5:32 am Post subject: Re: Highlighted ListView Item and ENTER |
|
|
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 |
|
|
jicman
Joined: 22 Dec 2004 Posts: 298 Location: Rochester, NY
|
Posted: Thu Dec 07, 2006 8:00 am Post subject: |
|
|
thanks. |
|
Back to top |
|
|
|