public fGame(PictureBox player2Picture, string player2Name, string imgPath) { InitializeComponent(); picPlayer2.BackgroundImage = player2Picture.BackgroundImage; lPlayer2Name.Text = player2Name; game = new Game(picPlayer1, player2Picture, lPlayer1Name.Text, player2Name); SetTriangles(); imagePath = imgPath; clientForm = this; }
//private void btnUploadImage2_Click(object sender, EventArgs e) //{ // fileDialogPlayer2.InitialDirectory = "D:\\C#\\Backgammon\\Backgammon\\Images"; // fileDialogPlayer2.Filter = "Image Files (*.jpg;*.jpeg;.*.gif; *.PNG)|*.jpg;*.jpeg;.*.gif;*.PNG"; // if (fileDialogPlayer2.ShowDialog() == DialogResult.OK) // { // pictureBoxPlayer2.BackgroundImage = new Bitmap(fileDialogPlayer2.FileName); // } //} private void btnNext_Click(object sender, EventArgs e) { if (textPlayer1Name.Text != null && pictureBoxPlayer1.BackgroundImage != null) { MessageBox.Show("Ai incarcat tot"); windowGame = new fGame(getPicture1, getPlayer1Name, imagePath); windowGame.Show(); this.DialogResult = DialogResult.Cancel; } else { MessageBox.Show("Nu ai incarcat tot"); } }
public fGame(PictureBox player1Picture, string player1Name, string imgPath) { InitializeComponent(); picPlayer1.BackgroundImage = player1Picture.BackgroundImage; lPlayer1Name.Text = player1Name; game = new Game(player1Picture, picPlayer2, player1Name, lPlayer2Name.Text); SetTriangles(); server = new TcpListener(System.Net.IPAddress.Any, 3000); server.Start(); t = new Thread(new ThreadStart(Asculta_Server)); workThread = true; imagePath = imgPath; t.Start(); serverForm = this; }