Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Opening a Picture from PictureBox1 on Form1 to PictureBox2 on Form2 [VB.NET[

I am trying a tarantula keeper's app and want to display the picture a user loads in the 'Add Tarantula' form in the 'My tarantulas' form. I have had a Google around but the queries always seem a little long and vague. Can someone please point me in the right direction please.
Resident Writer for MyGamer.Com and Horrify.Net
You can pass the Image object through the constructor of Form2.

Code
public class Form2 : Form
{
    public Form2(Image img)
    {
        pictureBox2.Image = img;
    }
}

And you can call it like this:
Code
public void SpawnSecondForm()
{
    Image img = pictureBox1.Image;
    Form2 form = new Form2(img);
    for2.Show();
}
I'm so confused lol. Thanks for the help, though.

Is this C#?
Resident Writer for MyGamer.Com and Horrify.Net
(Apr 15, 2018 10:44 AM)Effexion Wrote:  I'm so confused lol. Thanks for the help, though.

Is this C#?

Yes but if you know VB.net you should be able to read it. As long as you know how parameters work in VB.net you should have no problems understanding what I said.
(Apr 15, 2018 11:27 AM)Dalvik Wrote:  Yes but if you know VB.net you should be able to read it. As long as you know how parameters work in VB.net you should have no problems understanding what I said.

Yes, you're right. I have been out of practice for so long and wasn't that well-versed to begin with lol. Thanks for your help, sorted it.
Resident Writer for MyGamer.Com and Horrify.Net


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by NotAFedSep 10, 2018 09:21 PM 8 329 Sep 10, 2018 09:21 PM
Last Post: BahNahNah
[.NET] by adenfrMar 20, 2017 11:03 AM 3 190 Mar 20, 2017 11:03 AM
Last Post: Ninja
[.NET] by Moon RockJul 22, 2016 07:53 AM 2 218 Jul 22, 2016 07:53 AM
Last Post: Moon Rock