• <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++
            2022年国产精品久久久久| 国产福利电影一区二区三区久久久久成人精品综合 | 久久精品无码一区二区三区日韩 | 久久精品亚洲乱码伦伦中文| 青春久久| 伊人久久精品线影院| 99久久这里只精品国产免费| 狠狠久久亚洲欧美专区| 久久这里只有精品视频99| 久久亚洲精品中文字幕| 久久国产午夜精品一区二区三区| 久久精品国产日本波多野结衣| 狠狠狠色丁香婷婷综合久久俺| 久久天天躁狠狠躁夜夜不卡| 夜夜亚洲天天久久| 久久无码人妻一区二区三区午夜| 久久精品成人免费国产片小草| 久久精品国产亚洲AV无码娇色| 热综合一本伊人久久精品| 久久被窝电影亚洲爽爽爽| 狠狠色婷婷久久一区二区| 久久精品免费大片国产大片| 狠狠色丁香婷婷综合久久来| 无码国内精品久久人妻蜜桃| 日韩人妻无码一区二区三区久久99 | 久久久无码精品亚洲日韩京东传媒 | 综合人妻久久一区二区精品| 欧美久久一区二区三区| 一级做a爰片久久毛片人呢| 国内精品久久久久| 国产精品久久网| 国产精品久久久久久福利漫画| 亚洲精品tv久久久久久久久| 伊人久久大香线焦AV综合影院| 欧美国产成人久久精品| 四虎国产精品成人免费久久| 国产精品99久久久久久宅男小说| 人妻少妇精品久久| 国产精品乱码久久久久久软件| 亚洲中文久久精品无码| 久久精品无码专区免费青青|