Display image on 2nd form?

Contributor
16May2007,16:47   #1
shah123's Avatar
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
Go4Expert Founder
16May2007,16:49   #2
shabbir's Avatar
Have a static property in Form1 that can be accessible in the other form.
Contributor
16May2007,16:51   #3
shah123's Avatar
Can you be more specific Shabbir brother?
Contributor
16May2007,20:59   #4
shah123's Avatar
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
Go4Expert Founder
16May2007,21:12   #5
shabbir's Avatar
Have the property to give you list of images.
Contributor
16May2007,21:21   #6
shah123's Avatar
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
Go4Expert Founder
17May2007,08:09   #7
shabbir's Avatar
Make
Code:
public String getImages
as
Code:
public ArrayList getImages
Contributor
17May2007,16:54   #8
shah123's Avatar
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?
Contributor
17May2007,16:59   #9
shah123's Avatar
Its a game of two people so 2 people need to login and 2 images will be displayed on next form?
Go4Expert Founder
17May2007,18:23   #10
shabbir's Avatar
So its you to decide to have 2 properties or array list of images