• <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 王海光 閱讀(2638) 評論(0)  編輯 收藏 引用 所屬分類: C++
            久久精品国产亚洲av瑜伽| 久久av无码专区亚洲av桃花岛| 少妇高潮惨叫久久久久久| 久久亚洲春色中文字幕久久久| 久久午夜无码鲁丝片| 成人a毛片久久免费播放| 亚洲欧洲精品成人久久曰影片 | 天天爽天天狠久久久综合麻豆| 97精品国产97久久久久久免费| www.久久精品| 奇米影视7777久久精品人人爽| 狠狠88综合久久久久综合网 | 久久亚洲视频| 久久久噜噜噜久久中文福利| 久久综合狠狠综合久久激情 | 久久99精品久久久大学生| 热综合一本伊人久久精品| 国内精品久久久久| 亚洲va国产va天堂va久久| 亚洲欧洲久久久精品| 国产真实乱对白精彩久久| 久久久久久毛片免费播放| 亚洲国产欧美国产综合久久| 久久综合精品国产一区二区三区| 丁香狠狠色婷婷久久综合| 天堂久久天堂AV色综合| 久久亚洲国产最新网站| 日韩欧美亚洲国产精品字幕久久久| 999久久久免费国产精品播放| 97精品久久天干天天天按摩| 亚洲色婷婷综合久久| 伊人久久综合成人网| 一本久久a久久精品vr综合| 久久福利资源国产精品999| 欧美粉嫩小泬久久久久久久| 久久国产成人精品国产成人亚洲| 久久99精品国产99久久| 999久久久免费国产精品播放| 99久久免费国产精品| 久久99精品久久久久久齐齐 | 日韩AV无码久久一区二区 |