In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how the VB language to achieve slide effect, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to understand it!
Target cases in this section:
Before we start this case, let's review a question: what are the circumstances under which images can be loaded?
1. For example, the property picture of the form contains the property picture.
The 2.picturebox control can be loaded.
The 3.image control can be loaded.
The commonness of the above image loading: use the picture property to load.
The form forms style is configured through the borderStyle border style: fixed dialog is the form dialog style with only one close button. The zoom in and out buttons are hidden.
The image control loads pictures:
1. By default, when the control loads the picture, it renders the size corresponding to the original size of the picture.
two。 We can zoom the image as a whole after the strech property is configured to true.
If the strech property is false, a cropping effect occurs.
In this case, our ultimate goal: to achieve automatic switching of pictures.
1. Click the button "next" and the picture will show the next one.
two。 Click the button "previous" and the picture will show the previous one.
Method 1:
The switching effect of the two pictures:
You can use two image controls.
In the form_load event, the first picture is displayed first, and all the other images are hidden.
The display and hiding of the picture is set by the visible property.
The visible property is displayed for true.
The visible attribute is false to indicate hiding.
Method 2:
If there are a large number of pictures to show, then we need to make the rules of the picture:
1. First rename the picture to a regular value
two。 Load a picture through the loadpicture function, which returns a picture object
Use format:
Loadpicture (Picture path)
Example: load a picture in an image1 control.
Image1.Picture = LoadPicture (App.Path & "/ img/3.jpg")
The app.Path here represents the path to the folder where the current project file is stored.
So, how to display the next picture?
A = a + 1
If a = 1 Then
Image1.Picture = LoadPicture (App.Path & "/ img/" & a & ".jpg")
Else
MsgBox "is gone"
End If
How to cycle the display automatically?
A = a + 1
If a = 1 Then Image1.Picture = LoadPicture (App.Path & "/ img/" & a & ".jpg") Else MsgBox "no longer has" End IfEnd Sub "
Private Sub Command2_Click () a = a + 1If a
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.