Avatar of John Paul Sim
John Paul SimFlag for Philippines

asked on 

Moving Image to the next form with same image

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

??
Visual Basic.NETVisual Basic Classic

Avatar of undefined
Last Comment
Kyle Abrahams, PMP
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

"I would like may image like same as it from the next but I don't no how please I will need help "

You're going to have to be more SPECIFIC here.  What exactly are you trying to achieve?  Which part works, and which part doesn't?  I ~think~ you're trying to do something with Form2, but I'm really not sure...
ASKER CERTIFIED SOLUTION
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Auto close.  Suggested refactoring for simplification that can be referenced across multiple forms.
Visual Basic Classic
Visual Basic Classic

Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.

165K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo