Click here to Skip to main content
13,052,669 members (64,952 online)
Click here to Skip to main content
Add your own
alternative version


18 bookmarked
Posted 15 Dec 1999

A pager control wrapper class

, 15 Dec 1999
Rate this:
Please Sign up or sign in to vote.
This article presents a wrapper class for the pager control
  • Download demo project - 22 Kb
  • Download source files - 5 Kb
  • Sample Image - controls_pager.gif

    <!-- Article Starts -->

    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:

    Sample Image

    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.


    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.


    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


    About the Author

    Kirk Stowell
    CEO Codejock Technologies, LLC
    United States United States
    No Biography provided

    You may also be interested in...


    Comments and Discussions

    GeneralRe: Thanks Pin
    mla1542-Oct-06 8:00
    membermla1542-Oct-06 8:00 
    Generalc# version Pin
    matute2228-Feb-04 9:31
    membermatute2228-Feb-04 9:31 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

    Permalink | Advertise | Privacy | Terms of Use | Mobile
    Web02 | 2.8.170713.1 | Last Updated 16 Dec 1999
    Article Copyright 1999 by Kirk Stowell
    Everything else Copyright © CodeProject, 1999-2017
    Layout: fixed | fluid