• <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ù)
            大香网伊人久久综合网2020| 国产精品免费久久久久电影网| 久久久亚洲AV波多野结衣| 色偷偷偷久久伊人大杳蕉| 国产精品久久久久久福利漫画| 久久国产精品二国产精品| 99久久国产精品免费一区二区| 久久综合九色综合欧美狠狠| 欧美黑人激情性久久| 91亚洲国产成人久久精品网址| 久久综合久久综合亚洲| 亚洲综合久久综合激情久久| 久久AV高潮AV无码AV| 丁香五月综合久久激情| 久久久久亚洲Av无码专| 热99RE久久精品这里都是精品免费 | 国产成人无码精品久久久久免费| 久久精品国产亚洲AV影院| 国产精自产拍久久久久久蜜| 久久婷婷成人综合色综合| 久久精品国产清自在天天线| 武侠古典久久婷婷狼人伊人| 精品久久综合1区2区3区激情 | 亚洲精品国产综合久久一线| 色综合久久综合网观看| 精品人妻久久久久久888| av色综合久久天堂av色综合在| 四虎亚洲国产成人久久精品| 久久se精品一区二区影院| 夜夜亚洲天天久久| 久久精品国产一区二区三区| 国产福利电影一区二区三区,免费久久久久久久精 | 久久人做人爽一区二区三区| 久久精品无码一区二区三区日韩| 久久综合九色综合97_久久久| 国产成人久久AV免费| 大伊人青草狠狠久久| 国产精品亚洲美女久久久| 精品久久久无码中文字幕天天 | 亚洲人成精品久久久久| 无码国内精品久久人妻蜜桃 |