• <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++
            久久精品国产亚洲77777| 久久国产高清一区二区三区| 青青草原综合久久大伊人| 久久精品国产亚洲AV忘忧草18| 亚洲精品乱码久久久久久蜜桃图片 | 国产免费久久精品99re丫y| 中文国产成人精品久久亚洲精品AⅤ无码精品| 狠狠色丁香婷婷久久综合| 色婷婷综合久久久久中文一区二区| 国产精品无码久久综合| 久久人人超碰精品CAOPOREN| 久久婷婷国产剧情内射白浆| 久久99国产精品久久久| 久久精品国产72国产精福利| 午夜人妻久久久久久久久| 久久影视国产亚洲| 国产综合久久久久| 亚洲精品视频久久久| 欧美一区二区精品久久| 无码国内精品久久人妻| 欧美麻豆久久久久久中文| 久久综合丁香激情久久| 久久久免费精品re6| 久久久精品国产免大香伊| 狠狠综合久久综合中文88| 久久亚洲日韩精品一区二区三区| 欧美麻豆久久久久久中文| 久久国产成人亚洲精品影院| 日本久久久久久中文字幕| 久久99国产精品久久99| 1000部精品久久久久久久久| 精品国产乱码久久久久久人妻| 精品国产综合区久久久久久| 国产精品久久久久久福利漫画| 亚洲AV无码久久精品蜜桃| 欧美精品国产综合久久| 综合久久精品色| 久久精品免费一区二区| 一本色道久久HEZYO无码| 伊人久久综合成人网| 婷婷五月深深久久精品|