• <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 王海光 閱讀(1006) 評論(0)  編輯 收藏 引用 所屬分類: MFC
            久久亚洲AV成人无码电影| 久久久久亚洲精品天堂久久久久久 | 久久综合给久久狠狠97色| 久久九九兔免费精品6| 精品免费久久久久久久| 国产一区二区三精品久久久无广告| 国产免费福利体检区久久| 91麻豆国产精品91久久久| 国产精品9999久久久久| 亚洲国产精品无码久久青草| 久久久久久无码Av成人影院| 久久久久亚洲AV综合波多野结衣| 亚洲AV无码久久| 久久久久亚洲AV综合波多野结衣| 欧美va久久久噜噜噜久久| 久久夜色撩人精品国产| 欧美综合天天夜夜久久| 亚洲va中文字幕无码久久不卡| 久久综合伊人77777| 精品一区二区久久| 日本亚洲色大成网站WWW久久| 久久精品亚洲精品国产色婷| 深夜久久AAAAA级毛片免费看| 91精品国产高清久久久久久91| 男女久久久国产一区二区三区| 久久亚洲AV无码精品色午夜| 夜夜亚洲天天久久| 久久中文娱乐网| 国产精品久久成人影院| 久久久国产乱子伦精品作者| 欧美精品九九99久久在观看| 久久综合九色综合欧美就去吻| www亚洲欲色成人久久精品| 国产欧美一区二区久久| 99久久中文字幕| 91精品国产乱码久久久久久| 精品久久久久久久久午夜福利| 狼狼综合久久久久综合网| 亚洲精品美女久久久久99| 国产精品久久久久久久人人看 | 欧美一级久久久久久久大|