Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="pe"></param>
        protected virtual void OnColumnHeaderPaint(ColumnHeaderPaintEventArg pe)
        {
            if (this.SortOnColumnClick)
            {
                if (m_lvwColumnSorter.SortColumn == pe.ColumnHeader.Index)
                {
                    Rectangle rc      = pe.ClipRectangle;
                    Rectangle rcArrow = new Rectangle(rc.Right - 8 - 8, rc.Top + 4, 8, 8);

                    if (m_lvwColumnSorter.Order == SortOrder.Ascending)
                    {
                        DrawDownArrow(pe.Graphics, rcArrow);
                    }
                    else if (m_lvwColumnSorter.Order == SortOrder.Descending)
                    {
                        DrawUpArrow(pe.Graphics, rcArrow);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="m"></param>
        protected virtual void CddsItemPostPaint(ref System.Windows.Forms.Message m)
        {
            NMCUSTOMDRAW nmcd = ( NMCUSTOMDRAW )m.GetLParam(typeof(NMCUSTOMDRAW));

            int iColumn = nmcd.dwItemSpec;

            Rectangle rcHeader = new Rectangle(nmcd.rc.left,
                                               nmcd.rc.top,
                                               nmcd.rc.right - nmcd.rc.left,
                                               nmcd.rc.bottom - nmcd.rc.top);

            using (Graphics g = Graphics.FromHdc(nmcd.hdc))
            {
                ColumnHeaderPaintEventArg pe = new ColumnHeaderPaintEventArg(g, rcHeader, this.Columns[iColumn]);

                OnColumnHeaderPaint(pe);
            }

            // free resources and say to control skip default drawing
            m.Result = ( IntPtr )CustomDrawReturnFlags.CDRF_SKIPDEFAULT;
        }