VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Scroll a Form uing its own ScrollBars

by John G (1 Submission)
Category: Windows API Call/Explanation
Compatability: Visual Basic 3.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (12 Votes)

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

Download Scroll a Form uing its own ScrollBars

Download Scroll a Form uing its own ScrollBars (15 KB)

Scroll a Form uing its own ScrollBars Comments

No comments have been posted about Scroll a Form uing its own ScrollBars. Why not be the first to post a comment about Scroll a Form uing its own ScrollBars.

Post your comment

Subject:
Message:
0/1000 characters