Display image on 2nd form?

shah123's Avatar
Contributor
Hi, I have 2 forms, on one form i want to browse image and want to save them in array or arraylist and show on 2nd form that selected image. How would that be done?

One more query is that if i want to show that image in 2nd form can i set the size of image to be shown in a proper place as thier will be some more images will be later on adding to that form as well.

Please help. Thanks
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Have a static property in Form1 that can be accessible in the other form.
0
shah123's Avatar
Contributor
Can you be more specific Shabbir brother?
0
shah123's Avatar
Contributor
It worked now the image is in proper shape in the picture box but now the next question is

"how u will put them in some arraylist so i can show multiple images at one time in the picturebox on the form".

Thanks
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Have the property to give you list of images.
0
shah123's Avatar
Contributor
I made the property like following but giving exception

Login.cs
public String getImages
{
get{ return imgtextbox.text;}
}

tictactoe.cs
Login l=new Login();
Picturebox1.Load(l.getImages); // give exception here
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Make
Code:
public String getImages
as
Code:
public ArrayList getImages
0
shah123's Avatar
Contributor
I created two List fields as on Login Form

private List<string> imageList = new List<string>();
private List<string> username = new List<string>();

TicTacToe tic=new TicTacToe(usernametextBox.Text,imgTextbox.Text);

What I have to do to change in the constructor of TicTacToe so i can add in someway List of usernames.

Anyway to convert string of usernametextbox to ArrayList?
0
shah123's Avatar
Contributor
Its a game of two people so 2 people need to login and 2 images will be displayed on next form?
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
So its you to decide to have 2 properties or array list of images