How to Make Slide Show in VB.Net
Submitted by janobe on Wednesday, January 16, 2019 - 11:28.
In this tutorial, I will teach you how to make slide show in VB.Net. Slide show is a presentation of a series of pictures that is usually displayed in an electronic device like a projection screen to present clearly the text or images to an audience. Now, if you what to know how to make a program of it? It’s just simple if you only follow the steps that are shown below. So let’s start.
Step 4
Go to the solution explorer, right click and add a folder named it “images”. After that, add pictures in it.
Step 5
Double click the form and add the following codes to set a picture in the first load of the form.
Step 6
Double click the timer and create a method for changing the pictures continuously.
Step 7
Double click the “btnNext” Toolstrip Button and add the following codes for the next picture.
Step 8
Double click the “btnPrevious” Toolstrip Button and add the following codes for the previous picture.
For any questions about this article. You can contact me @
Email – [email protected]
Mobile No. – 09305235027 – TNT
Or feel free to comment below.
Creating Application
Step 1
Open Microsoft Visual Studio 2015 and create a new windows form application for vb.Step 2
Do the form just like thisStep 3
Open the code view and declare an array variable for storing all images. After that, set an incrementing array variable.- 'Set an Array of images
- Dim pics() As String = {"image1.jpg", "image2.jpg", "image3.jpg", "image4.jpg", "image5.jpg"}
- 'Set this to use in incrementing an array index.
- Dim i As Integer = 0
- Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- 'Set the first image in the first load of the form.
- PictureBox1.Image = Image.FromFile("images/" + pics(0))
- End Sub
- Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
- 'Set this formula to increment i by 1
- i += 1
- 'Set a validation of pictures
- If pics.Length = i Then
- i = 0
- End If
- 'Set to Load the image.
- PictureBox1.Image = Image.FromFile("images/" + pics(i))
- End Sub
- Private Sub ToolStripButton2_Click(sender As Object, e As EventArgs) Handles btnNext.Click
- 'Disable timer to prevent the next image from loading..
- Timer1.Enabled = False
- 'Set this formula to increment i by 1
- i += 1
- 'Set a validation of pictures
- If pics.Length = i Then
- i = 0
- End If
- 'Set to Load the image.
- PictureBox1.Image = Image.FromFile("images/" + pics(i))
- 'Re-Enable timer to resets the image loads in 5 seconds..
- Timer1.Enabled = True
- End Sub
- Private Sub ToolStripButton2_Click(sender As Object, e As EventArgs) Handles btnNext.Click
- 'Disable timer to prevent the next image from loading..
- Timer1.Enabled = False
- 'Set this formula to decrement i by 1
- i -= 1
- 'Set a validation of pictures
- If pics.Length = i Then
- i = 0
- End If
- 'Set to Load the image.
- PictureBox1.Image = Image.FromFile("images/" + pics(i))
- 'Re-Enable timer to resets the image loads in 5 seconds..
- Timer1.Enabled = True
- End Sub
Comments
Add new comment
- Add new comment
- 3902 views