• <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
            響應WM_CTLCOLOR消息
            WM_CTLCOLOR消息的響應函數.此函數的原型:
              afx_msg HBRUSH OnCtlColor(CDC *pDC,CWnd *pWnd,UINT nCtlColor);
              參數nCtlColor用于指定控件的類型,可以是:
              .CTLCOLOR_BTN       按鈕控件
              .CTLCOLOR_DLG       對話框
              .CTLCOLOR_EDIT      編輯框
              .CTLCOLOR_LISTBOX   列表控件
              .CTLCOLOR_MSGBOX    消息控件
              .CTLCOLOR_SCROLLBAR 滾動條控件
              .CTLCOLOR_STATIC    靜態控件


            MSDN中信息:

            The framework calls this member function when a child control is about to be drawn.

            1 afx_msg HBRUSH OnCtlColor(
            2    CDC* pDC,
            3    CWnd* pWnd,
            4    UINT nCtlColor 
            5 );

            Parameters

            pDC

            Contains a pointer to the display context for the child window. May be temporary.

            pWnd

            Contains a pointer to the control asking for the color. May be temporary.

            nCtlColor

            Contains one of the following values, specifying the type of control:

            • CTLCOLOR_BTN   Button control

            • CTLCOLOR_DLG   Dialog box

            • CTLCOLOR_EDIT   Edit control

            • CTLCOLOR_LISTBOX   List-box control

            • CTLCOLOR_MSGBOX   Message box

            • CTLCOLOR_SCROLLBAR   Scroll-bar control

            • CTLCOLOR_STATIC   Static control

            Return Value

            OnCtlColor must return a handle to the brush that is to be used for painting the control background.

            Example
             1 // This OnCtlColor handler will change the color of a static control
             2 // with the ID of IDC_MYSTATIC. The code assumes that the CPenWidthsDlg
             3 // class has an initialized and created CBrush member named m_brush.
             4 // The control will be painted with red text and a background
             5 // color of m_brush.
             6 HBRUSH CPenWidthsDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
             7 {
             8    // Call the base class implementation first! Otherwise, it may
             9    // undo what we're trying to accomplish here.
            10    HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
            11 
            12    // Are we painting the IDC_MYSTATIC control? We can use
            13    // CWnd::GetDlgCtrlID() to perform the most efficient test.
            14    if (pWnd->GetDlgCtrlID() == IDC_MYSTATIC)
            15    {
            16       // Set the text color to red
            17       pDC->SetTextColor(RGB(25500));
            18 
            19       // Set the background mode for text to transparent 
            20       // so background will show thru.
            21       pDC->SetBkMode(TRANSPARENT);
            22 
            23       // Return handle to our CBrush object
            24       hbr = m_brush;
            25    }
            26 
            27    return hbr;
            28 }
             

            Requirements

            Header: afxwin.h


            posted on 2012-09-12 16:34 王海光 閱讀(1010) 評論(0)  編輯 收藏 引用 所屬分類: MFC
            久久国产精品无| 精品久久久久国产免费| 国内精品免费久久影院| 亚洲午夜久久久精品影院| 久久免费香蕉视频| 久久精品国产亚洲AV久| 欧美大香线蕉线伊人久久| 66精品综合久久久久久久| 日韩欧美亚洲综合久久影院d3| 一本色道久久88综合日韩精品| 国产韩国精品一区二区三区久久| 看全色黄大色大片免费久久久| 国色天香久久久久久久小说| 欧美精品丝袜久久久中文字幕 | 88久久精品无码一区二区毛片| 久久精品国产亚洲精品| 伊人久久免费视频| 一本久久a久久精品亚洲| 久久久久久久综合综合狠狠| 久久人人爽人人爽人人片av高请| 久久午夜无码鲁丝片午夜精品| 91久久精品91久久性色| 精品久久久中文字幕人妻| 狠狠色伊人久久精品综合网| 久久亚洲精品人成综合网 | 亚洲精品无码专区久久久 | 精品无码久久久久国产动漫3d| 青青草国产精品久久| 久久亚洲私人国产精品| 久久福利资源国产精品999| 91精品免费久久久久久久久| 久久久久久国产精品免费无码| 久久超乳爆乳中文字幕| 久久久久久精品无码人妻| 久久久久亚洲AV成人网人人软件| 亚洲国产精品久久久久| 国产精品久久影院| 久久精品国产一区二区三区日韩| 久久综合综合久久97色| 久久精品免费一区二区三区| 国产亚洲综合久久系列|