• <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>
            面對(duì)現(xiàn)實(shí),超越自己
            逆水行舟,不進(jìn)則退
            posts - 269,comments - 32,trackbacks - 0
            重載 DrawItem 函數(shù)或Onpaint函數(shù)
            void CListCtrlCl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
            {
                // 重繪網(wǎng)格線 [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 );
                    }
                }
            }

            本文轉(zhuǎn)自:http://www.codeguru.com/cpp/controls/listview/gridlines/article.php/c963/Drawing-horizontal-and-vertical-gridlines.htm
            posted on 2013-07-12 11:10 王海光 閱讀(2654) 評(píng)論(0)  編輯 收藏 引用 所屬分類: C++
            91久久精品91久久性色| 一本久久a久久精品vr综合| 久久久久婷婷| 久久精品成人欧美大片| 国内精品久久九九国产精品| 久久精品国产亚洲Aⅴ香蕉| 久久综合香蕉国产蜜臀AV| 国产精品成人99久久久久91gav| 久久久久久久91精品免费观看| 97久久综合精品久久久综合| 久久九九久精品国产| 国产精品99久久99久久久| 欧美与黑人午夜性猛交久久久| 国产国产成人精品久久| 2021最新久久久视精品爱| 国产一区二区精品久久凹凸| 久久久久亚洲AV成人片| 污污内射久久一区二区欧美日韩 | 久久精品国产精品亚洲| 久久99精品久久久久久hb无码 | 免费精品久久天干天干| 国内精品伊人久久久久| 久久国产欧美日韩精品| 无码人妻久久一区二区三区免费 | 国产精品久久久久蜜芽| 久久综合欧美成人| 国产91色综合久久免费| 久久精品无码一区二区无码| 久久午夜福利无码1000合集| 亚洲国产成人精品无码久久久久久综合| 精品午夜久久福利大片| 国产精品免费福利久久| www性久久久com| 久久久中文字幕| 久久这里只有精品首页| 国产农村妇女毛片精品久久| 77777亚洲午夜久久多喷| 国产一级持黄大片99久久| 久久精品免费一区二区三区| 91亚洲国产成人久久精品| 精品99久久aaa一级毛片|