• <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++
            伊人久久大香线焦综合四虎| 亚洲中文精品久久久久久不卡| 97精品伊人久久大香线蕉app| 久久超碰97人人做人人爱| 久久国产精品99精品国产| 久久99精品久久久久婷婷| 久久国产乱子精品免费女| 久久久这里有精品中文字幕| 久久精品极品盛宴观看| 日本欧美久久久久免费播放网| 91久久精品视频| 日本五月天婷久久网站| 久久精品亚洲精品国产色婷 | 午夜精品久久影院蜜桃| 久久久久久精品无码人妻| avtt天堂网久久精品| 久久久久久亚洲精品不卡| 久久99精品久久久久久久不卡| 蜜桃麻豆www久久国产精品| 久久99精品久久久久久动态图| 久久亚洲天堂| 91精品婷婷国产综合久久| 国产亚洲美女精品久久久2020| 精品免费久久久久国产一区| 欧美丰满熟妇BBB久久久| 亚洲国产成人久久笫一页| 国产高清美女一级a毛片久久w| 欧美一区二区三区久久综合| 久久午夜无码鲁丝片午夜精品| 大伊人青草狠狠久久| 午夜精品久久久久久99热| 亚洲国产成人精品女人久久久 | 久久久黄片| 99热都是精品久久久久久| 久久久久久久亚洲Av无码| 久久热这里只有精品在线观看| 久久久WWW成人免费毛片| 久久精品国产WWW456C0M| 国内精品久久久久久久影视麻豆 | 久久久久高潮综合影院| 开心久久婷婷综合中文字幕|