-
Nov 22nd, 2014, 09:02 PM
#1
Thread Starter
Registered User
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...
-
Nov 23rd, 2014, 05:38 AM
#2
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.
-
Nov 23rd, 2014, 05:53 AM
#3
Thread Starter
Registered User
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....
-
Nov 23rd, 2014, 09:50 PM
#4
Re: Adding pictures and resources
Originally Posted by kayuan
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|