Scrolling Support for ATL Composite Controls

Here's a class that I wrote that adds scrolling support to any ATL Composite Control.

The following steps are needed to add scrolling...

  1. Include the ScrollImpl.h file
  2. #include "ScrollImpl.h"
  3. Add CScrollImpl to your inheritance tree
  4. public CScrollImpl
  5. Add the following entry to your Message Map
  6. CHAIN_MSG_MAP(CScrollImpl)
  7. Add a message handler for WM_INITDIALOG and add the following line to OnInitDialog...
  8. SetScrollSize( m_hWnd, xScrollPos, yScrollPos );
  9. Set xScrollPos to the position that you want horizontal scrolling to start and yScrollPos for the position you want vertical scrolling to start.
I've attached a sample workspace that contains the ScrollImpl.h file, a project with a composite control that supports scrolling and an MFC container for the control.

Downloads

Download demo project - 27 Kb


Comments

  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Packaged application development teams frequently operate with limited testing environments due to time and labor constraints. By virtualizing the entire application stack, packaged application development teams can deliver business results faster, at higher quality, and with lower risk.

  • One of the most foolproof ways for an online system to confirm, "Is it really you?" is by adding two-factor authentication. Modern two-factor solutions have evolved to support new, complex technology models that change how we use data, including cloud computing and bring-your-own-device (BYOD). However, not all two-factor authentication solutions are created equal. This guide walks through some of the key area of differentiation between two-factor authentication solutions and provides some concrete criteria …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds