Can anyone see any problem with this code

i think there is a simple mistake in this code although i canot find it.

Dim FileName As String

FileName = (GameTitle.Text + ".JPEG")
Image1.Visible = True
Image1.Picture = LoadPicture("F:BTEC National For IT PractitionersYear 1Unit 4Assignment 3GamePictures" & FileName)

Comments

  • : i think there is a simple mistake in this code although i canot find it.
    :
    : Dim FileName As String
    :
    : FileName = (GameTitle.Text + ".JPEG")
    : Image1.Visible = True
    : Image1.Picture = LoadPicture("F:BTEC National For IT PractitionersYear 1Unit 4Assignment 3GamePictures" & FileName)
    :
    why not use a microsoft common dialog control. select project then click on components. then name it for cd1.
    on command1 click event
    cd1.showopen
    image1.picture = loadpicture(cd1.filename)

    Don't quit, you'll get it. :-)

  • The only thing I can see that might be wrong here is this:

    FileName = (GameTitle.Text + ".JPEG")

    Unless you've programmed the "+" symbol to concatenate in the right place, this is what causes your error. (I know my compiler can't handle it)

    Just use:

    FileName = (GameTitle.Text & ".JPEG")

    As you did the second time.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion