Implementing standard scrolling behavior for a custom CWnd or CDialog-derived class using MFC is fairly non-trivial. There are at least 3 or 4 message handlers to write as well as a number of scrolling parameters for each scrollbar that need to be adjusted whene
ver your window or dialog is resized. In this article, I present a C++ helper class that can be used to add both horizontal and/or vertical scrolling to any CWnd or CDialog class. Unlike other implementations you may have seen, there is no scrollable dialog base class that you need to derive from. No change in your inheritance hierarchy is required to use the helper class (CScrollHelper).