2 Replies - 1970 Views - Last Post: 24 August 2012 - 07:25 AM Rate Topic: -----

#1 artemix22  Icon User is offline

  • D.I.C Head

Reputation: 12
  • View blog
  • Posts: 124
  • Joined: 21-January 12

image gallery

Posted 05 August 2012 - 10:26 AM

i made an application that hold many picture, user upload image to database, number of image is various, so it can't be predict, i can save them all, my problem is i want use single picture box and then a button (next, next, thing.. like facebook foto gallery) to display them back, but i can't do that, i have a code, but that code just can hold limited number of picture, here is the code :
Static Dim imgNum As Integer = 1
            imgNum += 1
            If imgNum > 5 Then imgNum = 1
            Select Case imgNum
                Case 1
                    PictureBox2.Image = My.Resources.pic1
                Case 2
                    PictureBox2.Image = My.Resources.pic2
                Case 3
                    PictureBox2.Image = My.Resources.pic3
                Case 4
                    PictureBox2.Image = My.Resources.pic4
                Case 5
                    PictureBox2.Image = My.Resources.pic5
            End Select


as you can see, that code just can hold defined number of image (5 image or more or less) and can't hold unpredict number of image.

thanks for your help.

Is This A Good Question/Topic? 0
  • +

Replies To: image gallery

#2 artemix22  Icon User is offline

  • D.I.C Head

Reputation: 12
  • View blog
  • Posts: 124
  • Joined: 21-January 12

Re: image gallery

Posted 05 August 2012 - 10:10 PM

looks like no one have any idea about this.. ok, thanks alot
Was This Post Helpful? 0
  • +
  • -

#3 deery5000  Icon User is offline

  • D.I.C Addict

Reputation: 36
  • View blog
  • Posts: 708
  • Joined: 09-May 09

Re: image gallery

Posted 24 August 2012 - 07:25 AM

first off , i suspect you havent written this code....

Yoru code specifies 5 images that are resources within your project. Theres no database in sight, if you use a database you need to create a table with filepaths to the image or the image itself. Then you need to connect to the database and query the values and store the results in an array.

Once thats done you can traverse the array to change the image on a button click.

I suggest you start small, create a database and connect to it. Have one colun with one row and attempt to get that value, build on it form there
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1