The program of this section redoes the previous program in C# and it also uses the .Net class Form. This simplifies the scrolling process (see full code listing). The program may be found in \IPlusPlus\Projects\C#\Sample02\MetricsB.
Like the previous program, both horizontal and vertical scrolling of text are implemented. The C# program is considerably simpler than the C++ counterpart, primarily because it uses the auto-scrolling feature of the Form class. All that is required is that the virtual scrolling area is set and the form control does the rest. This relieves the application of most of the calculations for scrolling.