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

  • Wednesday, September 24, 2014 8:00 AM - 9:00 AM PDT According to a recent Forrester Research report, many companies are choosing low-code platforms over traditional programming platforms, due to the speed with which low-code apps can be assembled and tested. With customer-facing applications on the rise, traditional programming platforms simply can't keep up with the "short schedules and rapid change cycles" required to develop these applications. Check out this upcoming webinar and join Clay Richardson from …

  • Live Event Date: September 10, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Modern mobile applications connect systems-of-engagement (mobile apps) with systems-of-record (traditional IT) to deliver new and innovative business value. But the lifecycle for development of mobile apps is also new and different. Emerging trends in mobile development call for faster delivery of incremental features, coupled with feedback from the users of the app "in the wild". This loop of continuous delivery and continuous feedback is …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds