How to Create an Image Slideshow Using VB.Net with Picturebox

2
509

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.

 

  • First is Open the visual basic, Select File on the menu, then click New and create a new project.

  • Then a New Project Dialog will appear. You can rename your project, depending on what you like to name it. After that click OK

 

  • After clicking OK, Design your form just like what I’ve show you below.

            Select a Picturebox in the toolbox and then a two Button. Rename the Button “Next” and “Previous” to the other button.

  • 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.

 

  • After you finish putting pictures, click the Next Button then write this code.
  1. Private Sub Btnnext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnnext.Click
  2. Btnprevious.Enabled = True
  3. Static i As Integer
  4. Dim incp As String
  5. incp = +1
  6. i += 1
  7. PictureBox1.Image = ImageList1.Images(i)
  8. If i = ImageList1.Images.Count - 1 Then
  9. i = -1
  10. End If
  11. End Sub
  • Then Click the Previous Button and add this code.
  1. Private Sub Btnprevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnprevious.Click
  2. Static i As Integer
  3. Dim incp As String
  4. incp = +1
  5. i += 1
  6. PictureBox1.Image = ImageList1.Images(i)
  7. If i = ImageList1.Images.Count - 1 Then
  8. i = -incp
  9. End If
  10. End Sub

 

  • After writing the codes, Go to Design Form and Click F5 to run the Program.

       Output:

If you have any questions or suggestions about Image Slideshow Using VB.Net, please contact me throught our contact page.

Download the Image Slideshow Using VB.Net full source code here.

 

Reader might read also:

 

 

 

Facebook Comments
(Visited 618 times, 1 visits today)

2 COMMENTS

  1. You really make it seem so easy together with your presentation but I find this topic to be really something that I feel I’d by no means understand. It sort of feels too complex and extremely extensive for me. I’m having a look ahead in your next put up, I’ll attempt to get the grasp of it!

  2. Wonderful goods from you, man. I’ve remember your stuff previous to and you’re simply extremely wonderful. I actually like what you have bought here, really like what you are stating and the best way during which you assert it. You’re making it entertaining and you still take care of to keep it sensible. I can’t wait to learn much more from you. That is actually a wonderful website.

LEAVE A REPLY

Please enter your comment!
Please enter your name here