CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2001
    Location
    CA, USA
    Posts
    1

    Multiple pictures in one image control

    How can I put multiple pictures in one image control during run-time. For example; If I have one image control, three command control buttons, and 3 picture and I want the pictures in the one image control to change as I click on the different run button during run time? Please Help


  2. #2
    Join Date
    Sep 2001
    Location
    Québec, Canada
    Posts
    1,923

    Re: Multiple pictures in one image control

    The samplest way is to add all the images you need to use on your form, and make them invisible (property visible at false).

    Then, you add one image control that you keep visible


    private sub Command1_Click()
    'ImageVisible is the image that changes
    'Image1 is one of the three invisible image
    ImageVisible.Picture = Image1.Picture
    end sub




    CodeGuru VB FAQ Visual Basic Frequently Asked Questions
    VB Code color Tool to color your VB code on CodeGuru
    Before you post Importants informations to know before posting

  3. #3
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Multiple pictures in one image control

    You can use Loadpicture to do this

    Picture1.Picture = LoadPicture("C:\test.bmp")




    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

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

Featured