Click here to Skip to main content
15,896,063 members
Articles / Desktop Programming / MFC

A Read-Only Combo with Selectable Text

Rate me:
Please Sign up or sign in to vote.
4.52/5 (14 votes)
30 Nov 20057 min read 102.6K   2.7K   32  
A combo box which behaves as a fully disabled combo box except that it allows you to select the text.
#if !defined(AFX_COMBOEDIT_H__12B7D0CA_67EB_4866_987E_70AB2849A53D__INCLUDED_)
#define AFX_COMBOEDIT_H__12B7D0CA_67EB_4866_987E_70AB2849A53D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ComboEdit.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CComboEdit window

class CComboEdit : public CEdit
{
// Construction
public:
	CComboEdit();

// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CComboEdit)
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CComboEdit();

	// Generated message map functions
protected:
	//{{AFX_MSG(CComboEdit)
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_COMBOEDIT_H__12B7D0CA_67EB_4866_987E_70AB2849A53D__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior)
Spain Spain
I'm originally from Leek, Staffordshire in the UK, but I now work as a C++/MFC developer in Madrid, Spain.

I followed an erratic study/career path from German to a PhD in something resembling political science and linguistics, eventually ending up in IT.

I'm still finding bustling streets, warm nights, beer and vitamin D a pretty heady combination.

Comments and Discussions