public void iniSlotsUser() { int a = 110, b = 173; for (int i = 4; i <= 7; i++) { a += 90; b = 320; pb[i] = new Carta(); pb[i].Location = new Point(a, b); pb[i].Size = new Size(78, 101); pb[i].BorderStyle = BorderStyle.FixedSingle; pb[i].Image = Image.FromFile("Carta0.jpg"); pb[i].Cursor = System.Windows.Forms.Cursors.Hand; pb[i].Click += new EventHandler(GameClick); this.Controls.Add(pb[i]); pb[i].BringToFront(); pb[i].Pos = i; } }
public void iniSlotsPozo() { int x = 110, y = 173; for (int k = 0; k <= 3; k++) { y = 173; x += 90; pb[k] = new Carta(); pb[k].Location = new Point(x, y); pb[k].Size = new Size(78, 101); pb[k].BorderStyle = BorderStyle.FixedSingle; pb[k].Image = Image.FromFile("Carta0.jpg"); pb[k].Cursor = System.Windows.Forms.Cursors.Hand; pb[k].Click += new EventHandler(GameopoClick); this.Controls.Add(pb[k]); pb[k].BringToFront(); pb[k].Pos = k; } }
void GameClick(object sender, EventArgs e) { if (label2.Text == "GANASTE!!!!!!") { bandera = true; } else { cartasel = ((Carta)sender); bandera = false; lbuser.Visible = false; lboponente.Visible = false; pb[0].Enabled = true; pb[1].Enabled = true; pb[2].Enabled = true; pb[3].Enabled = true; #if DEBUG pictureBox8.Image = cartasel.Image; #endif } }