Ejemplo n.º 1
0
        protected override void OnHandleCreated(EventArgs e)
        {
            base.OnHandleCreated(e);

            SystemImageListHelper.SetListViewImageList(this, CommVar.sil_s, false);
            API.SendMessage(Handle, API.LVM_SETVIEW, API.LV_VIEW_SMALLICON, 0);
            this.ColumnClick += ListView_ColumnClick;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Associates a SysImageList with a TreeView control
        /// </summary>
        /// <param name="treeView">TreeView control to associated ImageList with</param>
        /// <param name="sysImageList">System Image List to associate</param>
        /// <param name="forStateImages">Whether to add ImageList as StateImageList</param>
        public static void SetTreeViewImageList(
            TreeView treeView,
            SystemImageList sysImageList,
            bool forStateImages
            )
        {
            IntPtr wParam = (IntPtr)API.TVSIL_NORMAL;

            if (forStateImages)
            {
                wParam = (IntPtr)API.TVSIL_STATE;
            }
            API.SendMessage(
                treeView.Handle,
                API.TVM_SETIMAGELIST,
                wParam,
                sysImageList.Handle);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Associates a SysImageList with a ListView control
        /// </summary>
        /// <param name="listView">ListView control to associate ImageList with</param>
        /// <param name="sysImageList">System Image List to associate</param>
        /// <param name="forStateImages">Whether to add ImageList as StateImageList</param>
        public static void SetListViewImageList(
            ListView listView,
            SystemImageList sysImageList,
            bool forStateImages
            )
        {
            IntPtr wParam = (IntPtr)API.LVSIL_NORMAL;

            if (sysImageList.ImageListSize == SystemImageListSize.SmallIcons)
            {
                wParam = (IntPtr)API.LVSIL_SMALL;
            }
            if (forStateImages)
            {
                wParam = (IntPtr)API.LVSIL_STATE;
            }
            API.SendMessage(
                listView.Handle,
                API.LVM_SETIMAGELIST,
                wParam,
                sysImageList.Handle);
        }