How to Create an Image Slideshow Using VB.Net with Picturebox
Image Slideshow Using VB.Net is a presentation supplemented by or based on a series of projected images or photographic slides. On this tutorial I will show you how to create a simple slideshow of images in Vb.net using button and Picturebox.
Steps How to Create an Image Slideshow Using VB.Net with Picturebox
- Step 1: First is Open the visual basic, Select File on the menu, then click New and create a new project.
- Step 2: Then a New Project Dialog will appear. You can rename your project, depending on what you like to name it. After that click OK
- Step 3: After clicking OK, Design your form just like what I’ve shown you below.
Select a Picturebox in the toolbox and then a two Button. Rename the Button “Next” and “Previous” to the other button.
- Step 4: Then after designing your form. Select ImageList in the Toolbox
After Selecting ImageList in the toolbox, Click now the Imagelist Task (The Logo in the Upper Right)
Set the Image Size to “256,256” and the Image Bit Depth to “Depth32Bit”
Then Click Choose images to add and remove images that you like put in the Picture Box. After that Click OK if you’re finish.
- Step 5: After you finish putting pictures, click the Next Button then write this code.
Private Sub Btnnext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnnext.Click Btnprevious.Enabled = True Static i As Integer Dim incp As String incp = +1 i += 1 PictureBox1.Image = ImageList1.Images(i) If i = ImageList1.Images.Count - 1 Then i = -1 End If End Sub
- Step 6: Then Click the Previous Button and add this code.
Private Sub Btnprevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnprevious.Click Static i As Integer Dim incp As String incp = +1 i += 1 PictureBox1.Image = ImageList1.Images(i) If i = ImageList1.Images.Count - 1 Then i = -incp End If End Sub
- Step 7: After writing the codes, Go to Design Form and Click F5 to run the Program.
If you have any questions or suggestions about Image Slideshow Using VB.Net, please contact me through our contact page. Or simply leave a comment below.
Download the Image Slideshow Using VB.Net full source below.
The reader might read also: