• <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++
            一本久久久久久久| 亚洲成色999久久网站| 久久精品国产一区| 亚洲精品97久久中文字幕无码| 久久99国内精品自在现线| 久久精品毛片免费观看| 久久国产免费观看精品3| 一本大道加勒比久久综合| 性做久久久久久久久久久| 亚洲精品美女久久久久99小说 | 国产精品免费久久久久久久久| 国产精品九九久久免费视频 | 2021久久精品国产99国产精品| 久久嫩草影院免费看夜色| 久久久久久久久无码精品亚洲日韩 | 热99RE久久精品这里都是精品免费| 久久人人爽人人爽人人AV东京热| 国产麻豆精品久久一二三| 久久乐国产综合亚洲精品| 人人狠狠综合久久亚洲88| 日本免费久久久久久久网站| 久久久久国产亚洲AV麻豆| 九九99精品久久久久久| 久久久一本精品99久久精品66| 日韩AV毛片精品久久久| 亚洲精品NV久久久久久久久久| 草草久久久无码国产专区| 久久97久久97精品免视看| 久久免费视频网站| 久久综合久久性久99毛片| 国产A三级久久精品| 久久精品国产只有精品2020| 色婷婷综合久久久久中文| 久久精品九九亚洲精品| 久久久久久久亚洲精品| 久久亚洲国产精品成人AV秋霞| 欧洲精品久久久av无码电影| 一本色道久久88综合日韩精品| 久久久国产精品亚洲一区 | 久久精品视频一| 久久免费国产精品|