/// <summary> /// Associates a SysImageList with a ListView control /// </summary> /// <param name="listView">ListView control to associate ImageList with</param> /// <param name="Usage">State, Group, Normal, Small /// false=Set Small Icon List</param> /// <param name="IIlSize">Size of Images</param> public static void SetListViewImageList(ListView listView, LVSIL Usage, SHIL IIlSize) { Initializer(); int wParam = (int)Usage; IntPtr HImageList = m_lgImgList; if (IIlSize == SHIL.Small) { HImageList = m_smImgList; } else if (IIlSize == SHIL.Jumbo) { HImageList = m_jumboImgList; } else if (IIlSize == SHIL.XLarge) { HImageList = m_xlgImgList; } User32.SendMessage(listView.Handle, MSG.LVM_SETIMAGELIST, wParam, HImageList); }
public static extern int SendMessage(IntPtr hWnd, MSG Msg, LVSIL wParam, IntPtr lParam);