Current location - Loan Platform Complete Network - Big data management - The code of using scroll bar to browse in VB
The code of using scroll bar to browse in VB
Draw a picture 1, VScroll 1, HScroll 1, then draw a picture 1 in the picture 1. Set the Stretch of Image 1 to False, AutoSize (if there is such an attribute) to True, and both Left and Top are set to 0. The image should be placed in Image 1. Set the minimum values of VScroll 1 and HScroll 1 to 0.

Type Form_Load.

VScroll 1。 Max = Image 1。 Height-picture 1. Scale height

HScroll 1。 Max = Image 1。 Width-picture 1. Scale width

Enter the scroll of VScroll 1

Image 1。 Top = 0 - VScroll 1。 value

Type HScroll 1 for scrolling.

Image 1。 Left = 0 - HScroll 1。 value

Finally, it should be noted that the above code requires that the picture size in Image 1 must exceed the range that can be displayed in Picture 1, and the picture size in Image 1 cannot be too large, otherwise an error will be reported.