• <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 王海光 閱讀(1007) 評論(0)  編輯 收藏 引用 所屬分類: MFC
            久久久久黑人强伦姧人妻| 成人亚洲欧美久久久久 | 欧美激情精品久久久久| 国内精品久久九九国产精品| 四虎国产精品免费久久久| 国内精品免费久久影院| 久久无码高潮喷水| AAA级久久久精品无码片| 久久国产成人午夜AV影院| 久久久久se色偷偷亚洲精品av| 国产精品99精品久久免费| 久久久久久国产精品无码下载| 香蕉久久夜色精品升级完成| 久久精品三级视频| avtt天堂网久久精品| 久久精品国产欧美日韩99热| 97久久精品人人做人人爽| 久久久久久曰本AV免费免费| 精品久久久无码中文字幕天天| 麻豆AV一区二区三区久久| 欧美久久亚洲精品| A级毛片无码久久精品免费| 久久精品a亚洲国产v高清不卡| 午夜精品久久久久久影视riav | 91精品日韩人妻无码久久不卡 | 久久香蕉一级毛片| 久久久女人与动物群交毛片| 狠狠色丁香婷婷久久综合五月| 精品国产乱码久久久久久浪潮| 国产高潮国产高潮久久久| 精品国产乱码久久久久软件| 亚洲国产精品无码久久九九| 精品久久人人做人人爽综合| 97久久久久人妻精品专区 | 久久九九久精品国产免费直播| 日韩亚洲欧美久久久www综合网| 久久久婷婷五月亚洲97号色| 久久国产热精品波多野结衣AV| 久久久久久人妻无码| 国产亚洲精久久久久久无码| 国产成人精品久久免费动漫|