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.