Mousewheel Scrollable Print Preview Control

One glaring problem with Microsoft’s PrintPreviewControl, included in the .NET Framework, is that it does not scroll with the mouse wheel. Why they didn’t add that functionality is beyond me, as it’s simple to do. I’m still writing an article on the control; I plan to finish and release it soon.

A few notes about the control:

  1. There is yet no documentation available (aside from comments). The class is McPeak.Windows.Forms.PrintPreviewControl. Functionality is essentially the same as Microsoft.Windows.Forms.PrintPreviewControl.
  2. I added a PageCount property. PageCount is set during the PrintDocument’s PrintPage event.
  3. In the event that the print document has more than one page, attempting to scroll past the bottom of the page will jump the control to the top of the next page. You can set the Rows property to PageCount (ctrl.Rows = ctrl.PageCount) to achieve a continuous scroll ala Adobe Reader.
  4. Only vertical scrolling is supported at this time.

The .zip file contains the source code, assembly, and sample project.

11/7/2008 1:48:48 PM
© 2008 Jeremy McPeak