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

  • With JRebel, developers get to see their code changes immediately, fine-tune their code with incremental changes, debug, explore and deploy their code with ease (both locally and remotely), and ultimately spend more time coding instead of waiting for the dreaded application redeploy to finish. Every time a developer tests a code change it takes minutes to build and deploy the application. JRebel keeps the app server running at all times, so testing is instantaneous and interactive.

  • When it comes to desktops – physical or virtual – it's all about the applications. Cloud-hosted virtual desktops are growing fast because you get local data center-class security and 24x7 access with the complete personalization and flexibility of your own desktop. Organizations make five common mistakes when it comes to planning and implementing their application management strategy. This eBook tells you what they are and how to avoid them, and offers real-life case studies on customers who didn't …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds