• <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久久国产综合精品女不卡| 久久精品人人做人人爽97| 91久久九九无码成人网站| 奇米影视7777久久精品人人爽| 久久天天躁狠狠躁夜夜网站| 91久久福利国产成人精品| 国产精品亚洲综合久久| 四虎国产永久免费久久| 2021国产精品午夜久久| 国产成人AV综合久久| 麻豆一区二区99久久久久| 久久久久人妻一区精品| 国产成年无码久久久久毛片| 免费久久人人爽人人爽av| 国产99久久久国产精免费| 激情伊人五月天久久综合| 久久久久久久91精品免费观看| 久久精品这里热有精品| 久久亚洲精品成人av无码网站| 久久国产成人午夜aⅴ影院| 久久亚洲欧美国产精品| 亚洲午夜无码久久久久小说| 国产精品成人99久久久久| 99久久国语露脸精品国产| 午夜精品久久久久久中宇| 欧美精品乱码99久久蜜桃| 伊人久久精品影院| 亚洲国产天堂久久综合| 无码任你躁久久久久久| 久久天天躁狠狠躁夜夜av浪潮 | 2021少妇久久久久久久久久| 久久亚洲AV无码精品色午夜| 久久久久亚洲国产| 777午夜精品久久av蜜臀| 久久精品免费全国观看国产| 99久久做夜夜爱天天做精品|