• <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++
            久久久久久国产a免费观看黄色大片| 久久青青草视频| 亚洲国产成人久久综合碰碰动漫3d| 日韩精品久久久久久| 久久亚洲精品无码VA大香大香| 精品无码久久久久久尤物| 久久综合精品国产一区二区三区| 中文字幕热久久久久久久| 久久99精品久久久久久秒播| 久久久国产乱子伦精品作者| 亚洲国产精品成人AV无码久久综合影院 | 天堂久久天堂AV色综合 | 亚洲精品视频久久久| 热久久国产精品| 久久精品国产亚洲AV香蕉| 伊人久久五月天| 久久久久综合中文字幕| 精品久久久久久国产91| 久久精品人人做人人爽电影蜜月| 婷婷久久综合九色综合绿巨人| 伊人久久大香线焦综合四虎| 97热久久免费频精品99| 亚洲精品无码专区久久久| 久久精品国产亚洲AV香蕉| 天天综合久久一二三区| 久久天天躁狠狠躁夜夜av浪潮| 中文字幕成人精品久久不卡| 77777亚洲午夜久久多喷| 狠狠色丁香久久婷婷综合五月| 一本色道久久88—综合亚洲精品 | 日日狠狠久久偷偷色综合0| 久久99国产精品成人欧美| 久久综合精品国产一区二区三区| 久久精品这里只有精99品| 欧美激情精品久久久久久久九九九 | 久久精品国产99久久无毒不卡| 蜜臀av性久久久久蜜臀aⅴ| 色综合久久中文字幕无码| 久久久一本精品99久久精品88| 2021少妇久久久久久久久久| 欧美亚洲另类久久综合|