VB and C# Scrolling/Scaling OwnerDraw Control Templates

This is a template for using the .NET scrolling feature and getting it to behave the way you'd expect a scrolling user-drawn control to behave.

The templates are identical implementations in both VB .NET and C#.

They're not bad for what the .NET framework can do. This implements a sort of "triple" buffering scheme. Of course, there really is no replacement for C++/Win32 owner-drawn controls as far as responsiveness is concerned, but I've implemented very substantial and complex controls with the templates I've created, here.

Some of the implementation may seem redundant to the built-in .NET platform functionality, but it is clearly not. For one thing, it takes care of futzing around with all of the built-in auto-scrolling functionality and replaces it with something that is a bit easier to work with vis a vis dealing with a virtual canvas of a size greater than the ClientRectangle of the control.

In the example project form, the C# control is placed on the left, and the VB control is placed on the right.

C# is ever more popular than VB .NET is, nowadays, so I decided I would put both examples on here.

Even though my stronger suit has always been VB, by far, I am taking cues from the software community that people are going the way of C# in waves and droves. I translated my control template from VB to C# to give myself a crash course in navigating the differences.

Hopefully, if you're learning to navigate one language from the other, you can look at these identical implementations as a guide to compare and contrast what has been done.

Enjoy!

Last edited Dec 2, 2013 at 2:12 PM by nmoschkin, version 9