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

Visual Basic Help

Options
  • 27-09-2010 3:54pm
    #1
    Registered Users 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 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 Posts: 1,422 ✭✭✭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 Posts: 2,781 ✭✭✭amen


    this sounds like home work.

    though there were rules on providing solutions?


  • Registered Users 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