• <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>
            面對現(xiàn)實,超越自己
            逆水行舟,不進則退
            posts - 269,comments - 32,trackbacks - 0
            響應(yīng)WM_CTLCOLOR消息
            WM_CTLCOLOR消息的響應(yīng)函數(shù).此函數(shù)的原型:
              afx_msg HBRUSH OnCtlColor(CDC *pDC,CWnd *pWnd,UINT nCtlColor);
              參數(shù)nCtlColor用于指定控件的類型,可以是:
              .CTLCOLOR_BTN       按鈕控件
              .CTLCOLOR_DLG       對話框
              .CTLCOLOR_EDIT      編輯框
              .CTLCOLOR_LISTBOX   列表控件
              .CTLCOLOR_MSGBOX    消息控件
              .CTLCOLOR_SCROLLBAR 滾動條控件
              .CTLCOLOR_STATIC    靜態(tài)控件


            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 王海光 閱讀(1009) 評論(0)  編輯 收藏 引用 所屬分類: MFC
            久久国产免费| 99久久www免费人成精品| 尹人香蕉久久99天天拍| 性做久久久久久久久浪潮| 伊人精品久久久久7777| 久久99精品久久只有精品| 91精品国产高清久久久久久国产嫩草| 久久精品国产一区二区三区| 亚洲日本va中文字幕久久| 久久se精品一区二区| 久久激情五月丁香伊人| 亚洲午夜久久久影院伊人| 国产精品永久久久久久久久久 | 国产高清美女一级a毛片久久w| 人妻少妇精品久久| 精品一区二区久久| 午夜不卡久久精品无码免费| 久久99热这里只有精品国产| 久久精品国产亚洲av水果派| 日韩影院久久| 久久九九久精品国产| 中文字幕一区二区三区久久网站| 精品久久久无码人妻中文字幕| 国产精品免费久久久久影院| 狠狠色丁香久久综合婷婷| 亚洲αv久久久噜噜噜噜噜| 久久99这里只有精品国产| 久久久久久亚洲精品不卡| 99久久国产免费福利| 2021精品国产综合久久| 精品久久无码中文字幕| 熟妇人妻久久中文字幕| 亚洲精品国产字幕久久不卡| 中文字幕久久亚洲一区| 久久人搡人人玩人妻精品首页| 国内高清久久久久久| 久久精品成人免费观看97| 国产福利电影一区二区三区久久久久成人精品综合 | 亚洲精品无码专区久久久| 综合久久一区二区三区 | 亚洲色婷婷综合久久|