Scrollable Viewport for a Picture

Scrollable Viewport for a Picture

It’s easy to make a scrollable viewport for a picture in both VB3 VB4. In addition to a picture, you can also use other objects that grow. First, create a new form. Place a picture box on the form, name it “picParent,” and resize it. This will be the viewport. Place a picture box inside the other picture box (picParent) and name it “picPICTURE.” The value of the Left and Top properties must be zero. This one will contain the picture you want to view.Next, place a vertical scrollbar on the right of the picParent Picture. Name it “vsbPict.” This scrollbar should have the same Top and Height values as picParent. Do the same with a horizontal scrollbar. Place it on the bottom of “picParent”-the Left and Width values should be equal to picParent. Name it “hsbPic.” In both scrollbars, set the LargeChange property to the height and width of picParent, respectively. Then place this code on the declarations section of Form1. You can also copy this code to the Scroll event:

 Private Sub hsbPIC_Change()	picPicture.Left =hsbPIC.ValueEnd SubPrivate Sub vsbPIC_Change()	picPicture.Top =vsbPIC.ValueEnd SubPrivate Sub picPicture_Resize()	If picPicture.Height > picParent.Height Then		vsbPIC.Max =picParent.Height - picPicture.Height	Else		vsbPIC.Max = 0	End If	If picPicture.Width > picParent.Width Then		hsbPIC.Max =picParent.Width - picPicture.Width	Else		hsbPIC.Max =0	End If		vsbPIC.Value = 0		hsbPIC.Value = 0End Sub

Every time you load a new picture, the scrollbars will adjust to its size. Write the code to load the pictures, and write other code to deal with exceptions to the rules.

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes