CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Image Control

  1. #1
    Join Date
    Jan 2000
    Location
    IN
    Posts
    24

    Image Control

    I have an image control on my form. I am trying to load a picture into it at run-time. I am using the following piece of code for this:

    Set MyImageControl.Picture = LoadPicture("D:\MyPic.jpg")

    When I run the program, I get the following error:
    Compile Error: Wrong number of arguments or invalid property assignment
    And when I return to the code window, LoadPicture is highlighted.

    From everything that I have seen about the Image control, this should work. If I set the picture at design time, it works fine. Am I possible forgetting to include some Reference that I need? I have also tried using a PictureBox control and receive the same error. If anyone has any ideas, I would appreciate it.

    Thanks in advance


  2. #2
    Join Date
    Jan 2000
    Posts
    2

    Re: Image Control

    Hi, maybe you can try omitting the Set statement; just type:
    MyImageControl.Picture = LoadPicture("D:\MyPic.jpg")

    I am not 100% certain in your case, but I have been using LoadPicture with existing image controls in a form and it works.

    I hope this helps. :-)



  3. #3
    Join Date
    Jan 2000
    Location
    IN
    Posts
    24

    Re: Image Control

    Thanks for the reply, but I receive the same error even after omitting Set.


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