Exemplo n.º 1
0
        // Adds expanders to the groups, should be called in form's Show-event
        public void MakeCollapsable()
        {
            if (Environment.OSVersion.Version.Major < 6)
                return;

            foreach (ListViewGroup group in Groups)
            {
                var placeHolderGroup = new ExplorerListViewGroup();
                placeHolderGroup.CbSize = Marshal.SizeOf(placeHolderGroup);
                placeHolderGroup.State = ExplorerListViewGroupState.Collapsible;
                placeHolderGroup.Mask = ExplorerListViewGroupMask.State;
                placeHolderGroup.GroupId = GetGroupId(group);

                if (placeHolderGroup.GroupId >= 0)
                    NativeMethods.SendMessage(Handle, LVM_SETGROUPINFO, new IntPtr(placeHolderGroup.GroupId), ref placeHolderGroup);
            }
        }
Exemplo n.º 2
0
        public void MakeCollapsable() // Adds expanders to the groups, should be called in form's Show-event
        {
            if (Environment.OSVersion.Version.Major < 6)
            {
                return;
            }

            foreach (ListViewGroup group in Groups)
            {
                var placeHolderGroup = new ExplorerListViewGroup();
                placeHolderGroup.CbSize  = Marshal.SizeOf(placeHolderGroup);
                placeHolderGroup.State   = ExplorerListViewGroupState.Collapsible;
                placeHolderGroup.Mask    = ExplorerListViewGroupMask.State;
                placeHolderGroup.GroupId = GetGroupId(group);

                if (placeHolderGroup.GroupId >= 0)
                {
                    NativeMethods.SendMessage(Handle, LVM_SETGROUPINFO, new IntPtr(placeHolderGroup.GroupId), ref placeHolderGroup);
                }
            }
        }
Exemplo n.º 3
0
 public static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, ref ExplorerListViewGroup lParam);