VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Scroll a Form uing its own ScrollBars

John G  (1 Submission)   Windows API Call/Explanation   Visual Basic 3.0   Advanced   Wed 3rd February 2021

This simple example shows you how to use the FORMS very own scrollbars. No need to use pictureboxes and added horizontal and vertical scrollbars adjacent to it to allow display of a form larger than the screen. This could get quite messy. And yes, the Form does have its very own scrollbars. Take a look at the screen shot and also run the example.
A couple of APIs do most of the work for you

Assumes
Most VB programmers do not realize the Form has scrollbars and consequently create elaborate methods for displaying forms that are larger than the physical screen. This example shows how to use the Forms scrollbars using a couple of simple API's.

Side Effects
Controls such as Lines and Shapes, or for that matter any control that does not have a hwnd, will need to be repainted when scrolled out of view and back in again. A simple way around this is to put those controls in pictureboxes with AutoRedraw = True.

API Declarations
Several. See the accompanying Module.

Rate Scroll a Form uing its own ScrollBars (12(12 Vote))

Download Scroll a Form uing its own ScrollBars

Scroll a Form uing its own ScrollBars Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters