Results 1 to 4 of 4

Thread: load images in dir

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2009
    Posts
    56

    load images in dir

    hey guys i want to put an image strip on my form that will load all the images in the image directory automatically.now button..

    and can it scroll?meaning i dont want the form to bbe to wide..lol


    thx for the guidance!

  2. #2
    Hyperactive Member gonzalioz's Avatar
    Join Date
    Sep 2009
    Location
    <body></body>
    Posts
    508

    Re: load images in dir

    Put a flowlayoutpanel on your form and set the autoscroll property to true. Then add pictureboxes to it like this:

    Code:
            Dim dir As New IO.DirectoryInfo("C:\Patato\With\Salt\Images")
    
            For Each file As IO.FileInfo In dir.GetFiles
                Dim picturebox As New PictureBox
                picturebox.ImageLocation = file.FullName
                FlowLayoutPanel1.Controls.Add(picturebox)
            Next

  3. #3
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: load images in dir

    Hi,

    You should use a Listbox and Imagelist for that.
    Here you can find some explanation.
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  4. #4

    Thread Starter
    Member
    Join Date
    Nov 2009
    Posts
    56

    Re: load images in dir

    i have been trying it but its only one file at a time..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width