Results 1 to 4 of 4

Thread: [RESOLVED] LoadPicture & Dir$

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    307

    Resolved [RESOLVED] LoadPicture & Dir$

    Hey i saved the path of a picture to my database. I load my form and display the path in a textbox on my form. Then i use this:
    VB Code:
    1. If Dir$(" & txtlogo.text & ", vbDirectory) <> "" Then
    2.             Picture1.Picture = LoadPicture(txtLogo.Text)
    3.         End If

    but now the picture doesnt get loaded. Example the pic i have is C:\Emails\Pics\075.jpg

    when i removed the if statement, it worked fine, but there isnt always going to be a path in the txtlogo. and the path might get changed like the file gets moved, so i want to check if the file path exists before opening it.

    anyone know why the picture doesnt get displayed?

  2. #2
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,728

    Re: LoadPicture & Dir$

    try this:
    VB Code:
    1. If Dir$(txtLogo.Text) <> "" Then
    2.      Picture1.Picture = LoadPicture(txtLogo.Text)
    3.  End If
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    307

    Re: LoadPicture & Dir$

    cool thanx

  4. #4
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,728

    Re: LoadPicture & Dir$

    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


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