Results 1 to 6 of 6

Thread: Picture box flash images in folder

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2003
    Posts
    259

    Picture box flash images in folder

    I have a folder that will have image files that will change often by one network user and i want to be able to in a picture box flash the contents of this folder. so if there is 5 images in there then i would like to have one up then with a timer it goes to the next one after a certain time. need an idea where to start.

  2. #2
    Fanatic Member
    Join Date
    Mar 2005
    Posts
    651

    Re: Picture box flash images in folder

    Just a newb here but I am trying to do something.
    Will the image names be standardized?
    like img1 img2 img 24 or will they be random
    sun moon flower6 etc etc

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2003
    Posts
    259

    Re: Picture box flash images in folder

    no thats the problem the names will be different so it needs to be dynamic

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Picture box flash images in folder

    Use the Dir function to find out what files are in a folder, and the LoadPicture function to load the pictures.

    VB's help has good explanations and examples for both.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2003
    Posts
    259

    Re: Picture box flash images in folder

    ok thats a good idea to get me started. thanks

  6. #6
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Picture box flash images in folder

    Another option is to use a hidden FileListBox control. You can set its path & its filter (the Pattern property) to include only VB-supported images (i.e., *.jpg; *.bmp; etc)

    Your timer can simply loop thru the listbox.
    Code:
    Private Sub Timer_Timer()
        If File1.ListIndex = File1.ListCount - 1 Then ' on last list item
             File1.ListIndex = 0
        Else  ' move to next list item
             File1.ListIndex =  File1.ListIndex + 1
        End If
    End Sub
    Now, in your file listbox's Click event, load the picture
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

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