• <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++
            国产精品亚洲美女久久久| 久久只有这精品99| 亚洲一本综合久久| 亚洲国产精品成人久久蜜臀| 婷婷五月深深久久精品| 嫩草影院久久99| 久久久久亚洲AV综合波多野结衣| 色狠狠久久综合网| 久久亚洲欧美日本精品| 国产69精品久久久久观看软件| 精品久久久久香蕉网| 一本综合久久国产二区| 97精品伊人久久久大香线蕉| 久久亚洲AV成人无码| 成人精品一区二区久久久| 青青草原综合久久大伊人| 久久精品国产色蜜蜜麻豆 | 狠狠久久综合| 久久w5ww成w人免费| 亚洲中文字幕久久精品无码APP| 国产精品免费看久久久香蕉| 97久久精品国产精品青草| 国产aⅴ激情无码久久| 国产精品成人久久久| 一本一本久久a久久精品综合麻豆| 99久久婷婷国产一区二区 | 亚洲人AV永久一区二区三区久久| 国产91久久综合| 91精品国产色综久久| A级毛片无码久久精品免费| 久久er国产精品免费观看2| 国产V亚洲V天堂无码久久久| 久久久一本精品99久久精品88| 国内精品久久久久影院亚洲| 久久青青色综合| 久久久国产视频| 欧美黑人激情性久久| 久久精品国产亚洲av日韩| 久久精品国产99国产精品澳门| 好属妞这里只有精品久久| 青青青国产精品国产精品久久久久|