CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Installing SQL Server 2008
  • Writing UDFs for Firebird Embedded SQL Server
  • [Updated] Shutdown Manager
  • Building Windows Azure Cloud Service Applications with Azure Storage and the Azure SDK

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual Basic Programming > Visual Basic .NET
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Visual Basic .NET Microsoft Visual Basic .NET and related questions.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old November 3rd, 2009, 02:07 AM
    XiaoToose XiaoToose is offline
    Junior Member
     
    Join Date: Sep 2009
    Posts: 9
    XiaoToose is an unknown quantity at this point (<10)
    calling files from resource folder

    HI i need some help in using a picturebox to call pictures out of the resource folder and loop it

    previously i have coded:


    Me.PictureBox1.Image = Image.FromFile(Application.StartupPath + "\\JPG LandoltC\" + filePath + ".jpg")


    where filePath is the function to locate the name of the pictures







    but now i have to put everything into the .exe to make it more "sightly"


    so now
    i'm trying

    Me.PictureBox1.Image = My.Resources.filePath

    and its not working... can someone guide me?
    Reply With Quote
      #2    
    Old November 3rd, 2009, 04:19 AM
    HanneSThEGreaT's Avatar
    HanneSThEGreaT HanneSThEGreaT is offline
    The Moody Mod
    Power Poster
     
    Join Date: Jul 2001
    Location: Vereeniging, South Africa
    Posts: 7,685
    HanneSThEGreaT has a reputation beyond repute (3000+)HanneSThEGreaT has a reputation beyond repute (3000+)HanneSThEGreaT has a reputation beyond repute (3000+)HanneSThEGreaT has a reputation beyond repute (3000+)HanneSThEGreaT has a reputation beyond repute (3000+)HanneSThEGreaT has a reputation beyond repute (3000+)HanneSThEGreaT has a reputation beyond repute (3000+)HanneSThEGreaT has a reputation beyond repute (3000+)HanneSThEGreaT has a reputation beyond repute (3000+)HanneSThEGreaT has a reputation beyond repute (3000+)HanneSThEGreaT has a reputation beyond repute (3000+)
    Re: calling files from resource folder

    http://visualbasic.about.com/od/usin...a/ResVBNET.htm

    http://www.vb-helper.com/howto_net_e...resources.html
    __________________
    My Latest Articles :
    VB and Internet Explorer Browsing History || The TaskBar and VB.NET || Changing Mouse Settings with VB.NET || Creating Your Own Encryption / Decryption Program Using VB.NET 2005
    Find All My Articles : Here

    FAQs :
    .NET FrameWork FAQs || Visual Basic.NET FAQs || C# FAQs

    Be The Change That You Want To See In The World - Michael Scofield, Prison Break; Season 1 Episode 1

    Read This Before You Post || Acceptable Use Policy
    Reply With Quote
      #3    
    Old November 4th, 2009, 08:12 PM
    XiaoToose XiaoToose is offline
    Junior Member
     
    Join Date: Sep 2009
    Posts: 9
    XiaoToose is an unknown quantity at this point (<10)
    Re: calling files from resource folder

    the links shows how to call individual files only

    i can get there, but how do i loop it after calling the file?
    Reply With Quote
      #4    
    Old November 4th, 2009, 09:14 PM
    dglienna's Avatar
    dglienna dglienna is offline
    ex MVP - Visual Basic
    Power Poster
     
    Join Date: Jan 2006
    Location: Chicago, IL
    Posts: 9,895
    dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)
    Re: calling files from resource folder

    It's your file, so you know what's in there. No reason for a loop. Just include the code!
    __________________
    David CodeGuru Article: Bound Controls are Evil-VB6
    101 Samples: VB & C# VS2008 Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!
    Reply With Quote
      #5    
    Old November 5th, 2009, 03:10 AM
    XiaoToose XiaoToose is offline
    Junior Member
     
    Join Date: Sep 2009
    Posts: 9
    XiaoToose is an unknown quantity at this point (<10)
    Re: calling files from resource folder

    But there is a need for me to loop it.

    its like this.. when the form shows up. it will have to detect the input to see if its right or wrong and loop to the next randomise picture.

    after 5 pics it will have to search for the next level and show the pics again for another 5 time till wrong inputs are detected 3/5times..

    all these were coded in my function getfilepath, but after adding the pics into the resource folder, i have no idea how to call and loop it.
    Reply With Quote
      #6    
    Old November 5th, 2009, 07:06 PM
    dglienna's Avatar
    dglienna dglienna is offline
    ex MVP - Visual Basic
    Power Poster
     
    Join Date: Jan 2006
    Location: Chicago, IL
    Posts: 9,895
    dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)dglienna has a brilliant future (2000+)
    Re: calling files from resource folder

    First, load them into an array of some type. Then, you can loop thru it using a MOD 5, which will do what you want. 5 MOD 5 is 0, while 16 MOD 5 is 1
    __________________
    David CodeGuru Article: Bound Controls are Evil-VB6
    101 Samples: VB & C# VS2008 Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!
    Reply With Quote
      #7    
    Old November 5th, 2009, 08:34 PM
    XiaoToose XiaoToose is offline
    Junior Member
     
    Join Date: Sep 2009
    Posts: 9
    XiaoToose is an unknown quantity at this point (<10)
    Re: calling files from resource folder

    thanks you
    Reply With Quote
    Reply

    Bookmarks

    Tags
    .exe, calling loop, external file, loop, resource
    Go Back   CodeGuru Forums > Visual Basic Programming > Visual Basic .NET


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 12:55 AM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright WebMediaBrands Inc. 2002-2009