Results 1 to 4 of 4

Thread: Loading Picture in Image Box

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    55
    In a program I have an image box (ImgPicture) and a command button (CmdGo). What code would I put in CmdGo if I wanted it to load a file? I know that the file destination has to be in the code somewhere. Please Help

    Thanks in advance
    Beres

  2. #2
    Hyperactive Member CyberSurfer's Avatar
    Join Date
    Aug 2000
    Location
    Old London Town
    Posts
    425
    [code]

    sub cmdgo_click

    image1.picture = <imagepath>

    end sub

  3. #3
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    Beres
    what you really want is:
    Code:
    Private Sub cmdGo_Click()
    Dim filename As String
    
    filename = "c:\msh.gif"' or whatever
    
    Image1.Picture = LoadPicture(filename)
    
    End Sub
    CyberSurfer - test your code before posting it next time!
    Mark
    -------------------

  4. #4
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553
    Yeah, you're right Mark!

    Tip 2:

    To delete the picture, use ...= LoadPicture()

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