WinCE (VS 2008 C #) wrapper ListView

Source: Internet
Author: User

March 4, 2014 Tuesday Beijing Haidian Five Road clear


The interface looks a bit monotonous:

1. Multiple elections, no

2. Editors, no

3. Delete, no

4. Increased, no

5. Grid, no

A Ways to implement a table line:

When using the direct call static method Setgridlines (LISTVIEWLVW), you can, the class is out of Baidu, Khan a

    public class Drawgridlineforlistview {

        Private const int lvm_getextendedlistviewstyle = 0x1037;

        Private Const int lvm_setextendedlistviewstyle = 0x1036;

        Private Const int lvs_ex_gridlines = 0x1;

        [System.Runtime.InteropServices.DllImport ("Coredll.dll")]

        private static extern int Sendmessagew (int hWnd, int wmsg, int wParam, int lParam);

        [System.Runtime.InteropServices.DllImport ("Coredll.dll")]

        private static extern int GetFocus ();

        public static void Setgridlines (System.Windows.Forms.ListView lvw)

       {

           lvw. Focus ();

           int hWnd = GetFocus ();

           int extendedstyle = Sendmessagew (hWnd, Lvm_getextendedlistviewstyle, 0, 0);

           Extendedstyle |= Lvs_ex_gridlines;

           Sendmessagew (hWnd, Lvm_setextendedlistviewstyle, 0, Extendedstyle);

    }

After a static method is invoked, the effect is:


Two Pop-up menu:

1. Under the ItemCheck () method, bind a context menu so

With the mouse (or touch screen pen) long press, you can pop up a context menu, add, delete, change, can be done

Note: When you use the context menu to ContextMenu a control, you bind the control to a ListView

ContextMenu attribute, otherwise it's not going to come out.


The checkboxes property of 2.ListView is set to true, and a check box is displayed to implement multiple selections

    Private Voidlvmaterialidview_itemcheck (object sender, ItemCheckEventArgs e)
   {
        LvMaterialIDView.ContextMenu.Show (Lvmaterialidview, mouseposition);
    }

The effect is as follows:


To this end, ListView packaging, although not a qualified broker, this is the case.

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.