How to Implement click events in the listview control of Windows Mobile

Source: Internet
Author: User
I have been playing Windows Mobile programming recently and use the listview control. Chen mm made a project prototype and used the listview control to list all functions.

But after I run it, I find that you must double-click to activate an option. I think it is not very consistent with the user's usage habits. Click the response button. I checked it in the Forum and found some colleagues encountered the same problem. Http://www.wmisv.com.cn/bbs/dispbbs.asp? Boolean id = 2 & id = 131 As longListview has an activation attribute, which is set to click or double-click attribute, and then an itemactivate event is added to the event. By default, a double-click response is used. The problem about the listview control: I don't know how to implement the item click event. The listview in the simplified package cannot find such an event. Currently, I use the keypress event, however, it recognizes the key event on the PPC keyboard, and there is no way to click the event on the touch screen. If you use the selectindexchange event, you can take care of the touch screen click event. However, when using the keyboard with one-hand operations, you only need to obtain the focus to stimulate the event. Solution to the second problem: Private void listview_selectedindexchanged (Object sender, eventargs e) listview. selectedindexcollection indexes = This. listview. selectedindices; foreach (INT index in indexes) string S = This. listview. items [Index]. subitems [1]. text ;}}// simpler method private void listview_selectedindexchanged (Object sender, eventargs e) {string S = This. listview. focuseditem. subitems [1]. text ;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.