Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C# (http://www.go4expert.com/forums/c-sharp/)
-   -   Display image on 2nd form? (http://www.go4expert.com/forums/display-image-2nd-form-t4334/)

shah123 16May2007 16:47

Display image on 2nd form?
 
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

shabbir 16May2007 16:49

Re: Display image on 2nd form?
 
Have a static property in Form1 that can be accessible in the other form.

shah123 16May2007 16:51

Re: Display image on 2nd form?
 
Can you be more specific Shabbir brother?

shah123 16May2007 20:59

Re: Display image on 2nd form?
 
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

shabbir 16May2007 21:12

Re: Display image on 2nd form?
 
Have the property to give you list of images. :D

shah123 16May2007 21:21

Re: Display image on 2nd form?
 
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

shabbir 17May2007 08:09

Re: Display image on 2nd form?
 
Make
Code:

public String getImages
as
Code:

public ArrayList getImages

shah123 17May2007 16:54

Re: Display image on 2nd form?
 
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?

shah123 17May2007 16:59

Re: Display image on 2nd form?
 
Its a game of two people so 2 people need to login and 2 images will be displayed on next form?

shabbir 17May2007 18:23

Re: Display image on 2nd form?
 
So its you to decide to have 2 properties or array list of images


All times are GMT +5.5. The time now is 05:46.