Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Visual Basic Help

  • 27-09-2010 2:54pm
    #1
    Registered Users, Registered Users 2 Posts: 82 ✭✭


    I need to make a programme with constantly changing image files. The files in question will be located on the C drive. Not sure where to begin with this, I'm not too familiar with VB. So far I'm going along the lines of having a timer with the code

    Dim s1 As String = "c:\temp\image"
    Dim s2 As String = ".bmp"
    Dim num As Integer = (i) ' construct file name by concatenating 3 things

    pbxDisp.Image = Image.FromFile("s1 & num & s2")

    I want to increment the image number by one each time but am completely lost!!!


Comments

  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    Dim s1 As String = "c:\temp\image"
     Dim s2 As String = ".bmp"
    Dim num As Integer = (i)                        ' construct file name by concatenating 3 things
    do while num <= 10         
        pbxDisp.Image = Image.FromFile("s1" & num & "s2")
        num = num + 1
    loop
    
    

    Will loop up to 10.


  • Registered Users, Registered Users 2 Posts: 1,423 ✭✭✭Merrion


    You don't need the quotes in:
    pbxDisp.Image = Image.FromFile("s1" & num & "s2")
    

    should be
    pbxDisp.Image = Image.FromFile(s1 & num & s2)
    


  • Registered Users, Registered Users 2 Posts: 2,781 ✭✭✭amen


    this sounds like home work.

    though there were rules on providing solutions?


  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    amen wrote: »
    this sounds like home work.

    though there were rules on providing solutions?

    The rules are basically explain you're problem and provide some code. The OP did both.


Advertisement