#pragma once // CPropertyGridInPlaceEdit #define WM_PG_ENDLABELEDIT WM_USER+488 class CPropertyGridInPlaceEdit : public CEdit { DECLARE_DYNAMIC(CPropertyGridInPlaceEdit) public: CPropertyGridInPlaceEdit(CWnd* pParent, CRect& rect, DWORD dwStyle, UINT nID, CString sInitText); virtual ~CPropertyGridInPlaceEdit(); void SetColors(COLORREF clrBack, COLORREF clrText); public: void CancelEdit(); void EndEdit(); public: virtual BOOL PreTranslateMessage(MSG* pMsg); protected: //{{AFX_MSG(CPropertyGridInPlaceEdit) afx_msg void OnKillFocus(CWnd* pNewWnd); afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg UINT OnGetDlgCode(); afx_msg HBRUSH CtlColor ( CDC* pDC, UINT nCtlColor ); //}}AFX_MSG DECLARE_MESSAGE_MAP() private: CString m_sInitText; BOOL m_bExitOnArrows; CRect m_Rect; COLORREF m_clrBack; COLORREF m_clrText; CBrush m_Brush; };