派生了一个组合框类,切换时编辑框总是空的
class CComboBoxNew : public CComboBox
class CComboBoxNew : public CComboBox{// Constructionpublic: CComboBoxNew();// Attributespublic: CBrush m_brushSel;//画刷:选中 CBrush m_brushNormal;//画刷:普通// Operationspublic:// Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CComboBoxNew) public: virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); virtual int CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct); virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct); protected: virtual void PreSubclassWindow();// virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); //}}AFX_VIRTUAL// Implementationpublic: virtual ~CComboBoxNew(); // Generated message map functionsprotected: //{{AFX_MSG(CComboBoxNew)// afx_msg void OnNcPaint(); afx_msg void OnPaint(); //}}AFX_MSG DECLARE_MESSAGE_MAP()};