Pager Control

Saturday Oct 17th 1998 by Kirk Stowell

Pager Control

The class CCJPagerCtrl is fairly simple to use. It can be used in either a dialog or view. For demo purposes, I implemented it in a dialog using a CToolBar, but you can use any control or view class as the child window. Open your dialog in your resource editor and add a custom control. Modify the properties of the control as shown below:

In the OnInitDialog() section, add the following code:

// TODO: Add extra initialization here
if (!m_wndToolBar.Create(&m_Pager) ||
	TRACE0("Failed to create toolbar\n");
	return -1;      // fail to create

// Make the toolbar flat.
m_wndToolBar.ModifyStyle(0, 0x0800);

// Set the child HWND.

// Set the pager style to PGS_HORZ.

// Set the button size to 15.

// Determine size of child
SIZE Size;

// Set the scroll area for pager.
m_Pager.SetScrollArea(Size.cx+15, Size.cy+15);

If you are using Visual C++ 5, you will need to include the support file comm_control.h in your project, unless you have installed the SDK, in which case you won't need this. If you have any questions, feel free to drop me a line.

Download demo project - 23 KB

Download source - 5 KB

Mobile Site | Full Site
Copyright 2018 © QuinStreet Inc. All Rights Reserved