Results 1 to 4 of 4

Thread: Adding pictures and resources

  1. #1

    Thread Starter
    Registered User
    Join Date
    Nov 2014
    Posts
    2

    Adding pictures and resources

    Hello, newbie here.... my question is that can pictures be added to the forms without adding them in the resources but by writing code about it? And can pictures transfered from one form to another form? Thankyou for all the helps provided...

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Adding pictures and resources

    Images can be loaded into a PictureBox at run time by setting the Image or ImageLocation property or calling the Load method. The first option (Image property) requires you to create an Image object, which can be done various ways, while the other two require you to provide the path, either local or remote, of an image file or some service that returns image data.

    Images are objects like any other so you can pass them around like you do any other object. If you know how to pass a String from one form to another then you know how to pass an Image from one form to another. In fact, you know how to pass anything from one form to another because every object can be treated the same way. If you don't know how to do it for any object then follow the Blog link in my signature and check out my three-part post on Data Among Multiple Forms.

  3. #3

    Thread Starter
    Registered User
    Join Date
    Nov 2014
    Posts
    2

    Re: Adding pictures and resources

    So the code for adding the picture into the form maybe picturebox1.imagelocation= "C/:......(file location)"? will this work?

    while for transfering picture from one form to another, can be picturebox1.image = frm1.picturebox2.image ?

    thankyou for the advices given above....

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Adding pictures and resources

    Quote Originally Posted by kayuan View Post
    So the code for adding the picture into the form maybe picturebox1.imagelocation= "C/:......(file location)"? will this work?

    while for transfering picture from one form to another, can be picturebox1.image = frm1.picturebox2.image ?

    thankyou for the advices given above....
    What happened when you tried it for yourself?

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