CMFCSpinButtonCtrl Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at CMFCSpinButtonCtrl Class.

The CMFCSpinButtonCtrl class supports a visual manager that draws a spin button control.

class CMFCSpinButtonCtrl : public CSpinButtonCtrl  

Public Constructors

NameDescription
CMFCSpinButtonCtrl::CMFCSpinButtonCtrlDefault constructor.
CMFCSpinButtonCtrl::~CMFCSpinButtonCtrlDestructor.

Public Methods

NameDescription
CMFCSpinButtonCtrl::OnDrawRepaints the current spin button control.

To use a visual manager to draw a spin button control in your application, replace all instances of the CSpinButtonCtrl class with the CMFCSpinButtonCtrl class.

The following example demonstrates how to create an object of the CMFCSpinButtonCtrl class and use its Create method.

	CMFCSpinButtonCtrl* pWndSpin = new CMFCSpinButtonCtrl;
	CRect rectSpin(1,1,10,10);
	CMFCPropertyGridCtrl* pWndList = new CMFCPropertyGridCtrl();
	if (!pWndSpin->Create(WS_CHILD | WS_VISIBLE | UDS_ARROWKEYS | UDS_SETBUDDYINT | UDS_NOTHOUSANDS, rectSpin, pWndList, AFX_PROPLIST_ID_INPLACE))
	{
		return 0;
	}

CObject

CCmdTarget

CWnd

CSpinButtonCtrl

CMFCSpinButtonCtrl

Header: afxspinbuttonctrl.h

Repaints the current spin button control.

virtual void OnDraw(CDC* pDC);

Parameters

[in] pDC
A pointer to a device context.

Remarks

The framework calls the CMFCSpinButtonCtrl::OnPaint method to handle the CWnd::OnPaint message, and that method in turn calls this CMFCSpinButtonCtrl::OnDraw method. Override this method to customize the way the framework draws the spin button control.

Hierarchy Chart
Classes
CMFCVisualManager Class

Show: