• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            面對現實,超越自己
            逆水行舟,不進則退
            posts - 269,comments - 32,trackbacks - 0
            重載 DrawItem 函數或Onpaint函數
            void CListCtrlCl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
            {
                // 重繪網格線 [7/12/2013 dell]
                const MSG *msg = GetCurrentMessage();
                DefWindowProc( msg->message, msg->wParam, msg->lParam );

                // Draw the lines only for LVS_REPORT mode
                if( (GetStyle() & LVS_TYPEMASK) == LVS_REPORT )
                {
                    // Get the number of columns
                    CClientDC dc(this );
                    CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
                    int nColumnCount = pHeader->GetItemCount();

                    // The bottom of the header corresponds to the top of the line 
                    RECT rect, rectCol;
                    pHeader->GetClientRect( &rect );
                    int top = rect.bottom;

                    // Now get the client rect so we know the line length and
                    
            // when to stop
                    GetClientRect( &rect );

                    if( !GetItemRect( 1, &rectCol, LVIR_BOUNDS ))
                        return;

                    int height1 = rectCol.bottom - rectCol.top;

                    // The border of the column is offset by the horz scroll
                    int borderx = 0 - GetScrollPos( SB_HORZ );
                    forint i = 0; i < nColumnCount; i++ )
                    {
                        // Get the next border
                        borderx += GetColumnWidth( i );

                        // if next border is outside client area, break out
                        if( borderx >= rect.right ) break;

                        // Draw the line.
                        dc.MoveTo( borderx-1, top/*top*/);
                        dc.LineTo( borderx-1, (2+lpDrawItemStruct->itemID)*height1/*rect.bottom*/ );
                    }

                    // Draw the horizontal grid lines

                    
            // First get the height
                    if( !GetItemRect( 0, &rect, LVIR_BOUNDS ))
                        return;

                    int height = rect.bottom - rect.top;

                    GetClientRect( &rect );
                    int width = rect.right;

                    for(int i = 1; i <= lpDrawItemStruct->itemID+1; i++ )
                    {
                        dc.MoveTo( 0, top + height*i);
                        dc.LineTo( width, top + height*i );
                    }
                }
            }

            本文轉自:http://www.codeguru.com/cpp/controls/listview/gridlines/article.php/c963/Drawing-horizontal-and-vertical-gridlines.htm
            posted on 2013-07-12 11:10 王海光 閱讀(2653) 評論(0)  編輯 收藏 引用 所屬分類: C++
            亚洲国产日韩欧美久久| 久久综合噜噜激激的五月天| 久久久久高潮综合影院| 久久久久久精品久久久久| 亚洲色大成网站www久久九| 国产一区二区三精品久久久无广告| 亚洲一本综合久久| 久久九九久精品国产免费直播| 亚洲精品乱码久久久久久蜜桃图片 | 成人综合久久精品色婷婷| 精品蜜臀久久久久99网站| 亚洲国产精品无码久久九九| 亚洲第一极品精品无码久久| 中文字幕一区二区三区久久网站| 色狠狠久久综合网| 久久精品中文字幕第23页| 99国产精品久久| 久久大香香蕉国产| 2019久久久高清456| 久久九九全国免费| 狠狠色噜噜狠狠狠狠狠色综合久久| 97久久国产综合精品女不卡 | 国产精品久久久久久久久免费 | 久久久久成人精品无码中文字幕 | 亚洲国产精品无码久久久秋霞2| 成人精品一区二区久久| 93精91精品国产综合久久香蕉| 亚洲va久久久噜噜噜久久| 久久伊人五月丁香狠狠色| 久久99精品九九九久久婷婷| 伊人久久综在合线亚洲2019| 成人国内精品久久久久影院| 久久精品国产亚洲av麻豆色欲| 亚洲欧美成人综合久久久| 久久不见久久见免费影院www日本| 久久久久久久久久久精品尤物 | 久久五月精品中文字幕| 欧美亚洲色综久久精品国产 | 丁香五月网久久综合| www久久久天天com| 久久亚洲精品视频|