Click here to Skip to main content
15,881,600 members
Articles / Desktop Programming / MFC

An AutoRepeat Button Class

Rate me:
Please Sign up or sign in to vote.
4.45/5 (6 votes)
14 Apr 20025 min read 142K   1.8K   53  
A button control that autorepeats after a set period of time
#if !defined(AFX_AUTOREPEATBUTTON_H__3F2FF2BD_C05C_11D5_A04D_006067718D04__INCLUDED_)
#define AFX_AUTOREPEATBUTTON_H__3F2FF2BD_C05C_11D5_A04D_006067718D04__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// CAutoRepeatButton window

class CAutoRepeatButton : public CButton
{
// Construction
public:
	CAutoRepeatButton();

// Attributes
public:

// Operations
public:

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

// Implementation
public:
	virtual ~CAutoRepeatButton();

	// Generated message map functions
protected:
        UINT sent;
	//{{AFX_MSG(CAutoRepeatButton)
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnTimer(UINT nIDEvent);
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

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

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

#endif // !defined(AFX_AUTOREPEATBUTTON_H__3F2FF2BD_C05C_11D5_A04D_006067718D04__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
Retired
United States United States
PhD, Computer Science, Carnegie Mellon University, 1975
Certificate in Forensic Science and the Law, Duquesne University, 2008

Co-Author, [i]Win32 Programming[/i]

Comments and Discussions