• <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++
            亚洲精品乱码久久久久久久久久久久| 精品无码久久久久国产动漫3d| 精品国产日韩久久亚洲| 午夜精品久久久久| 国产精品99久久久久久人| 久久久久国产亚洲AV麻豆| 久久久久久久久66精品片| 欧美黑人激情性久久| 亚洲国产精品无码久久青草 | 伊人久久大香线蕉综合5g| 精品人妻伦九区久久AAA片69| 一本久久久久久久| 色综合久久无码中文字幕| 久久精品国产亚洲综合色| 精品久久久久久久无码| 漂亮人妻被中出中文字幕久久 | 国产午夜精品理论片久久| 久久精品国产精品亚洲下载| 久久无码高潮喷水| 国产激情久久久久影院老熟女免费 | 九九精品久久久久久噜噜| 曰曰摸天天摸人人看久久久| 色欲av伊人久久大香线蕉影院 | 亚洲精品乱码久久久久久蜜桃 | 人妻无码精品久久亚瑟影视 | 久久亚洲精品无码AV红樱桃| 伊人久久大香线蕉AV一区二区| 国产精品久久久久乳精品爆| 好属妞这里只有精品久久| 伊人久久大香线蕉av不卡| 久久久www免费人成精品| 久久国产视屏| 国产亚洲精午夜久久久久久| 青青青青久久精品国产| 久久www免费人成看国产片| 国产成人久久AV免费| 97久久久久人妻精品专区| 久久AV高清无码| 四虎国产精品免费久久5151| 久久久久夜夜夜精品国产| 国产成年无码久久久久毛片|