コード例 #1
0
ファイル: Groups.cs プロジェクト: wxytkzc/GitHubCode
        /// <summary>
        /// Modify the space between groups
        /// </summary>
        /// <returns></returns>
        protected int SetGroupSpacing()
        {
            if (this.ListView.SpaceBetweenGroups <= 0)
            {
                return(0);
            }

            NativeMethods.LVGROUPMETRICS metrics = new NativeMethods.LVGROUPMETRICS();
            metrics.cbSize = ((uint)Marshal.SizeOf(typeof(NativeMethods.LVGROUPMETRICS)));
            metrics.mask   = (uint)GroupMetricsMask.LVGMF_BORDERSIZE;
            metrics.Bottom = (uint)this.ListView.SpaceBetweenGroups;
            return(NativeMethods.SetGroupMetrics(this.ListView, this.GroupId, metrics));
        }
コード例 #2
0
        internal void ResizeLastGroup()
        {
            // Don't mess with the control in design mode
            if (this.IsDesignMode)
                return;

            // Sanity checks
            if (this.GetItemCount() == 0 || !this.ShowGroups || this.Groups.Count == 0)
                return;

            // Get the last group and make sure we know which OLVGroup it came from
            ListViewGroup grp = this.Groups[this.Groups.Count-1];
            OLVGroup olvGroup = grp.Tag as OLVGroup;
            if (olvGroup == null)
                return;

            int height = this.GetItem(0).Bounds.Height;

            // Is the Horizontal scrollbar visible
            if (NativeMethods.HasHorizontalScrollBar(this))
                height += SystemInformation.HorizontalScrollBarHeight;

            if (this.SpaceBetweenGroups > height)
                return;

            NativeMethods.LVGROUPMETRICS metrics = new NativeMethods.LVGROUPMETRICS();
            metrics.cbSize = ((uint)Marshal.SizeOf(typeof(NativeMethods.LVGROUPMETRICS)));
            metrics.mask = (uint)GroupMetricsMask.LVGMF_BORDERSIZE;
            metrics.Bottom = (uint)height;
            NativeMethods.SetGroupMetrics(this, olvGroup.GroupId, metrics);
        }
コード例 #3
0
ファイル: ObjectListView.cs プロジェクト: heliwave/QuranCode
        private void SetGroupSpacing() {
            if (!this.IsHandleCreated)
                return;

            NativeMethods.LVGROUPMETRICS metrics = new NativeMethods.LVGROUPMETRICS();
            metrics.cbSize = ((uint)Marshal.SizeOf(typeof(NativeMethods.LVGROUPMETRICS)));
            metrics.mask = (uint)GroupMetricsMask.LVGMF_BORDERSIZE;
            metrics.Bottom = (uint)this.SpaceBetweenGroups;
            NativeMethods.SetGroupMetrics(this, metrics);
        }
コード例 #4
0
        /// <summary>
        /// Modify the space between groups
        /// </summary>
        /// <returns></returns>
        protected int SetGroupSpacing() {
            if (this.ListView.SpaceBetweenGroups <= 0)
                return 0;

            NativeMethods.LVGROUPMETRICS metrics = new NativeMethods.LVGROUPMETRICS();
            metrics.cbSize = ((uint)Marshal.SizeOf(typeof(NativeMethods.LVGROUPMETRICS)));
            metrics.mask = (uint)GroupMetricsMask.LVGMF_BORDERSIZE;
            metrics.Bottom = (uint)this.ListView.SpaceBetweenGroups;
            return NativeMethods.SetGroupMetrics(this.ListView, this.GroupId, metrics);
        }