p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   C# (http://p2p.wrox.com/forumdisplay.php?f=22)
-   -   How to load multiple Images on the Form? (http://p2p.wrox.com/showthread.php?t=58006)

shah123 May 17th, 2007 08:48 AM

How to load multiple Images on the Form?
 
I have one form which is login form which contains username and image browsing field. Now in

Login.cs

Code:

private void LoadGameButton_Click(object sender, EventArgs e)
            {
      TicTacToe tic=new TicTacToe(usernametextBox.Text,imgTextbox.Text);
                if (imgTextbox.Text.Equals(""))
                {
                    MessageBox.Show("Please select any image");
                    return;
                }
                else
                {
                    tic.Show();
                   // this.Hide();
                }
                }

In TicTacToe.cs

Code:

public TicTacToe(String strText,string img)
        {
            InitializeComponent();
            if (strText.Equals(""))
            {
                label2.Text = "Guest";
            }
            else
            {
                label2.Text = strText;

            }

            pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
            //pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;

            pictureBox1.Load(img);
            pictureBox1.Refresh();
        }

Question is:
I defined two picturebox fields on this form where i can load 2 people images but now how to write the code so that once the user is logged in image will come in one picturebox and when second user is logged in it will come in second picturebox and after that login form should be hidden.

Please help?


jack_3 May 20th, 2007 09:28 PM

Have a look this may help

http://forums.asp.net/t/1109733.aspx



All times are GMT -4. The time now is 09:56 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.