• <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>
            面對(duì)現(xiàn)實(shí),超越自己
            逆水行舟,不進(jì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       對(duì)話框
              .CTLCOLOR_EDIT      編輯框
              .CTLCOLOR_LISTBOX   列表控件
              .CTLCOLOR_MSGBOX    消息控件
              .CTLCOLOR_SCROLLBAR 滾動(dòng)條控件
              .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 王海光 閱讀(1007) 評(píng)論(0)  編輯 收藏 引用 所屬分類: MFC
            亚洲国产精品综合久久一线| 久久伊人五月天论坛| 久久精品人妻中文系列| 久久精品国产2020| 久久久久亚洲精品天堂| 久久最新精品国产| 性高湖久久久久久久久AAAAA| 午夜精品久久久久久久久| 99re这里只有精品热久久| 久久亚洲视频| 久久精品九九亚洲精品天堂| 久久综合久久综合亚洲| 青草影院天堂男人久久| 色偷偷88888欧美精品久久久 | 伊人色综合久久天天人守人婷| 人妻精品久久无码专区精东影业 | 国产精品一久久香蕉国产线看观看| 88久久精品无码一区二区毛片| 成人午夜精品无码区久久| 国产精品综合久久第一页 | 国产精品久久久天天影视| 2021久久精品免费观看| 精品综合久久久久久88小说| 久久精品国产第一区二区三区| 7777精品伊人久久久大香线蕉 | 久久久久亚洲av成人无码电影| 精品国产乱码久久久久久郑州公司 | 办公室久久精品| 久久久久成人精品无码中文字幕| 久久综合九色综合精品| 久久A级毛片免费观看| 伊人久久大香线蕉av不变影院| 伊人久久无码精品中文字幕| 久久天天躁狠狠躁夜夜av浪潮| 93精91精品国产综合久久香蕉| 漂亮人妻被黑人久久精品| 久久亚洲AV成人无码国产| 囯产极品美女高潮无套久久久| 一本久久综合亚洲鲁鲁五月天亚洲欧美一区二区 | 伊人伊成久久人综合网777| 久久久精品国产亚洲成人满18免费网站 |