• <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>

             1 // Color.h
             2 // Colorref's to use with your Programs
             3 
             4 #define RED        RGB(127,  0,  0)
             5 #define GREEN      RGB(  0,127,  0)
             6 #define BLUE       RGB(  0,  0,127)
             7 #define LIGHTRED   RGB(255,  0,  0)
             8 #define LIGHTGREEN RGB(  0,255,  0)
             9 #define LIGHTBLUE  RGB(  0,  0,255)
            10 #define BLACK      RGB(  0,  0,  0)
            11 #define WHITE      RGB(255,255,255)
            12 #define GRAY       RGB(192,192,192)
            13 
            14 ///////////////////////////////////////////
            15 
            16 
            17 #include "color.h"
            18 /////////////////////////////////////////////////////////////////////////////
            19 // CColorStatic window
            20 class CColorStatic : public CStatic
            21 {
            22 // Construction
            23 public:
            24     void SetTextColor(COLORREF crColor); // This Function is to set the Color for the Text.
            25     void SetBkColor(COLORREF crColor); // This Function is to set the BackGround Color for the Text.
            26     CColorStatic();
            27 
            28 // Overrides
            29     // ClassWizard generated virtual function overrides
            30     //{{AFX_VIRTUAL(CColorStatic)
            31     //}}AFX_VIRTUAL
            32 
            33     virtual ~CColorStatic();
            34 
            35     // Generated message map functions
            36 protected:
            37     //{{AFX_MSG(CColorStatic)
            38 
            39     CBrush m_brBkgnd; // Holds Brush Color for the Static Text
            40     COLORREF m_crBkColor; // Holds the Background Color for the Text
            41     COLORREF m_crTextColor; // Holds the Color for the Text
            42 
            43     afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
            44     //}}AFX_MSG
            45 
            46     DECLARE_MESSAGE_MAP()
            47 };
            48 
            49 



             1 // ColorEdit.cpp : implementation file
             2 //
             3 
             4 #include "stdafx.h"
             5 #include "ColorEdit.h"
             6 #include "Color.h" // File Holding (#define)'s for COLORREF Values
             7 
             8 #ifdef _DEBUG
             9 #define new DEBUG_NEW
            10 #undef THIS_FILE
            11 static char THIS_FILE[] = __FILE__;
            12 #endif
            13 
            14 /////////////////////////////////////////////////////////////////////////////
            15 // CColorEdit
            16 
            17 CColorEdit::CColorEdit()
            18 {
            19     m_crBkColor = ::GetSysColor(COLOR_3DFACE); // Initializing background color to the system face color.
            20     m_crTextColor = BLACK; // Initializing text color to black
            21     m_brBkgnd.CreateSolidBrush(m_crBkColor); // Creating the Brush Color For the Edit Box Background
            22 }
            23 
            24 CColorEdit::~CColorEdit()
            25 {
            26 }
            27 
            28 
            29 BEGIN_MESSAGE_MAP(CColorEdit, CEdit)
            30     //{{AFX_MSG_MAP(CColorEdit)
            31     ON_WM_CTLCOLOR_REFLECT()
            32     //}}AFX_MSG_MAP
            33 END_MESSAGE_MAP()
            34 
            35 /////////////////////////////////////////////////////////////////////////////
            36 // CColorEdit message handlers
            37 
            38 void CColorEdit::SetTextColor(COLORREF crColor)
            39 {
            40     m_crTextColor = crColor; // Passing the value passed by the dialog to the member varaible for Text Color
            41     RedrawWindow();
            42 }
            43 
            44 void CColorEdit::SetBkColor(COLORREF crColor)
            45 {
            46     m_crBkColor = crColor; // Passing the value passed by the dialog to the member varaible for Backgound Color
            47     m_brBkgnd.DeleteObject(); // Deleting any Previous Brush Colors if any existed.
            48     m_brBkgnd.CreateSolidBrush(crColor); // Creating the Brush Color For the Edit Box Background
            49     RedrawWindow();
            50 }
            51 
            52 
            53 
            54 HBRUSH CColorEdit::CtlColor(CDC* pDC, UINT nCtlColor)
            55 {
            56     HBRUSH hbr;
            57     hbr = (HBRUSH)m_brBkgnd; // Passing a Handle to the Brush
            58     pDC->SetBkColor(m_crBkColor); // Setting the Color of the Text Background to the one passed by the Dialog
            59     pDC->SetTextColor(m_crTextColor); // Setting the Text Color to the one Passed by the Dialog
            60 
            61     if (nCtlColor)       // To get rid of compiler warning
            62       nCtlColor += 0;
            63 
            64     return hbr;
            65 }
            66 
            67 BOOL CColorEdit::SetReadOnly(BOOL flag)
            68 {
            69    if (flag == TRUE)
            70       SetBkColor(m_crBkColor);
            71    else
            72       SetBkColor(WHITE);
            73 
            74    return CEdit::SetReadOnly(flag);
            75 }
            76 
            77 
            Posted on 2007-04-13 16:50 艾凡赫 閱讀(3315) 評論(0)  編輯 收藏 引用 所屬分類: MFC技術(shù)
            99久久国产热无码精品免费久久久久| 久久久久久久久久久久中文字幕 | 久久精品成人影院| 久久免费美女视频| 日韩亚洲国产综合久久久| 狠狠色婷婷久久综合频道日韩| 久久精品久久久久观看99水蜜桃| 久久精品国产亚洲AV无码娇色| 久久久久久国产精品无码超碰| 国内精品欧美久久精品| 久久精品无码一区二区app| 人妻无码精品久久亚瑟影视| 少妇无套内谢久久久久| 99久久无码一区人妻a黑| 国产一区二区久久久| 久久久久无码精品国产不卡| 91精品国产9l久久久久| 精品熟女少妇av免费久久| 国产精品永久久久久久久久久| 成人资源影音先锋久久资源网| 国产福利电影一区二区三区久久老子无码午夜伦不 | 久久精品免费全国观看国产| 亚洲国产成人久久综合碰碰动漫3d| 国产精品综合久久第一页| 77777亚洲午夜久久多喷| 青青草国产精品久久久久| 久久久久亚洲AV无码观看| 色综合久久综合网观看| 久久精品亚洲中文字幕无码麻豆| 久久国产视频99电影| 99国产欧美精品久久久蜜芽| 日韩欧美亚洲综合久久| 欧美日韩中文字幕久久久不卡 | 丰满少妇高潮惨叫久久久| 九九精品久久久久久噜噜| 久久久WWW免费人成精品| 久久精品国产半推半就| 日本福利片国产午夜久久| 久久这里只有精品18| 久久国产精品-久久精品| 亚洲国产另类久久久精品|