Results 1 to 15 of 15

Thread: syntax question

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    London, UK
    Posts
    32
    Whats wrong with this code (Faze1 is a random number from 1-3, Face is a picturebox:

    If Faze1 = 1 Then FACE = (App.Path & "\Antonio.bmp")

    This continues up to 3 with a different .bmp picture each time, but the program never show the picture it highlights the & and comes up with the error 'Type Mismatch'
    I don't have the MSDN help collection so I can't find the correct usage.
    Thanks for any help.
    CGB

  2. #2
    Guest
    you are trying to send a string value to Face, not a picture!

    try
    '#####
    Face.loadpicture(Path)
    '#####
    instead.

    MSDN has a website that you can look at. It is a mirror of the CD's

    [Edited by wossname on 08-26-2000 at 11:23 AM]

  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    London, UK
    Posts
    32

    Smile

    Thanks!
    CGB

  4. #4

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    London, UK
    Posts
    32
    but that doesn't work!
    i just tried it
    CGB

  5. #5
    Hyperactive Member CyberSurfer's Avatar
    Join Date
    Aug 2000
    Location
    Old London Town
    Posts
    425

    Talking

    Try this:

    [code]
    dim path as string
    dim faze1 as integer

    path = App.path + "\Antonio.bmp"

    if faze1 = 1 then

    face.picture = path

    else

    end if

  6. #6

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    London, UK
    Posts
    32

    Smile

    thanks, i'll try it
    CGB

  7. #7

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    London, UK
    Posts
    32

    Unhappy

    it still doesn't work
    CGB

  8. #8
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Rotterdam, Netherlands
    Posts
    386
    You need to use

    Set FACE.Picture = LoadPicture(sPath)
    Hope this helps

    Crazy D

  9. #9
    Guest

    Talking Try this:

    Code:
    Face.Picture = LoadPicture(App.Path & "\Antonio.bmp")
    It should work.

    Hope this helps.

  10. #10

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    London, UK
    Posts
    32
    it now says, in an error window and you have the choice to debug or end:

    object variable or with block variable not set

    any ideas?
    CGB

  11. #11
    Guest
    What part does it highlight?

  12. #12

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    London, UK
    Posts
    32
    Face.Picture = LoadPicture(Path)

    that part
    CGB

  13. #13
    Guest
    Try:
    Code:
    Set Face.Picture = LoadPicture(App.Path & "\Antonio.bmp")
    Even though the first suggestion worked on my computer.

  14. #14

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    London, UK
    Posts
    32
    i'll give it a go.
    if not do you mind checking over the full code related to this prob.? (its not much)
    ok back in a sec..
    CGB

  15. #15

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    London, UK
    Posts
    32

    Talking

    i had the picture dimmed as a picture box and was making one other idiotic mistake.
    i tried what you suggested 1st time and it worked.
    thanks for your help.
    you probably wont be asking me for any but thanks.
    CGB

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