• <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 艾凡赫 閱讀(3307) 評(píng)論(0)  編輯 收藏 引用 所屬分類(lèi): MFC技術(shù)
            色综合久久综精品| 人妻无码αv中文字幕久久| 青青草原综合久久| 久久久久久亚洲精品无码| 久久婷婷是五月综合色狠狠| 中文精品久久久久人妻不卡| 久久偷看各类wc女厕嘘嘘| 久久精品这里热有精品| 久久久久久午夜精品| 国产成人精品久久二区二区| 亚洲精品国精品久久99热| www久久久天天com| 2021最新久久久视精品爱| 天天综合久久久网| 中文无码久久精品| 久久这里只有精品视频99| 国产精品福利一区二区久久| 欧美久久久久久| 国内精品久久久久久麻豆| 成人国内精品久久久久一区 | 婷婷久久综合九色综合绿巨人| 蜜臀av性久久久久蜜臀aⅴ| 久久久精品视频免费观看| 久久99国产乱子伦精品免费| 日产精品久久久久久久| 国产精品免费久久久久久久久 | 久久久久国产一级毛片高清板| 久久久无码人妻精品无码| 91麻豆国产精品91久久久| 一本久久综合亚洲鲁鲁五月天| 99久久国产亚洲高清观看2024| 国内精品久久久久影院日本| 久久这里只有精品18| 久久受www免费人成_看片中文| 久久一区二区三区99| 久久综合成人网| 亚洲精品NV久久久久久久久久 | 久久亚洲天堂| 一级做a爰片久久毛片看看| 午夜视频久久久久一区| 午夜精品久久影院蜜桃|