We help IT Professionals succeed at work.
Get Started

Moving Image to the next form with same image

204 Views
Last Modified: 2017-12-15
I would like may image like same as it from the next but I don't no how please I will need help

form1 code
Public Class form1
    Dim images(49) As Bitmap
    Dim pos As Integer = 0
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Form2.Show()
        Me.Close()
    End Sub

    Private Sub Form6_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        images(0) = WindowsApplication1.My.Resources.B1
        images(1) = WindowsApplication1.My.Resources.B2
        images(2) = WindowsApplication1.My.Resources.B3
        images(3) = WindowsApplication1.My.Resources.B4
        images(4) = WindowsApplication1.My.Resources.B5
        images(5) = WindowsApplication1.My.Resources.B6
        images(6) = WindowsApplication1.My.Resources.B7
        images(7) = WindowsApplication1.My.Resources.B8
        images(8) = WindowsApplication1.My.Resources.B9
        images(9) = WindowsApplication1.My.Resources.B10
        images(10) = WindowsApplication1.My.Resources.B11
        images(11) = WindowsApplication1.My.Resources.B12
        images(12) = WindowsApplication1.My.Resources.B13
        images(13) = WindowsApplication1.My.Resources.B14
        images(14) = WindowsApplication1.My.Resources.B15
        images(15) = WindowsApplication1.My.Resources.B16
        images(16) = WindowsApplication1.My.Resources.B17
        images(17) = WindowsApplication1.My.Resources.B18
        images(18) = WindowsApplication1.My.Resources.B19
        images(19) = WindowsApplication1.My.Resources.B20

        PictureBox1.Image = images(pos)
    End Sub

    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        pos = pos + 1
        If pos <= 19 Then
            PictureBox1.Image = images(pos)
            Button3.Enabled = True
        Else
            pos = 19
            Button2.Enabled = False
        End If
    End Sub

    Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
        pos = pos - 1
        If pos >= 0 Then
            PictureBox1.Image = images(pos)
            Button2.Enabled = True
        Else
            pos = 0
            Button3.Enabled = False
        End If
    End Sub
End Class

form2 code

??
Comment
Watch Question
Director of Information Technology
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE