// set button check all conditons and then enable run button private void bet_set_button_Click(object sender, EventArgs e) { if (plyrNme.Equals("Grany") && dog > 0 && nmPrice.Value > 0 && nmPrice.Value < gany) { Grny = new Plyer("Grany", dog, Convert.ToInt32(nmPrice.Value), gany); race_btn.Enabled = true; grany_msg.Text = "Grany select " + Grny.dog + " with the Bet " + Grny.budget; } else if (plyrNme.Equals("Richard") && dog > 0 && nmPrice.Value > 0 && nmPrice.Value < Richrd) { richrd = new Plyer("Richard", dog, Convert.ToInt32(nmPrice.Value), Richrd); race_btn.Enabled = true; Richard_msg.Text = "Richard select " + richrd.dog + " with the Bet " + richrd.budget; } else if (plyrNme.Equals("Pretlo") && dog > 0 && nmPrice.Value > 0 && nmPrice.Value < Prtlo) { pretlo = new Plyer("Pretlo", dog, Convert.ToInt32(nmPrice.Value), Prtlo); race_btn.Enabled = true; pretlo_msg.Text = "Pretlo select " + pretlo.dog + " with the Bet " + pretlo.budget; } else { MessageBox.Show("Need to select the Details "); } dog = 0; plyrNme = ""; }
public GreyhoundPlays() { // setting location of dogs InitializeComponent(); Grny = new Plyer("Grany", 0, 0, gany); richrd = new Plyer("Richard", 0, 0, Richrd); pretlo = new Plyer("Pretlo", 0, 0, Prtlo); race_btn.Enabled = false; }
public void reset() { dog = 0; plyrNme = ""; rambo1.Left = 0; rambo2.Left = 0; rambo3.Left = 0; rambo4.Left = 0; grany_msg.Text = "Grany has " + gany; Richard_msg.Text = "Richard has " + Richrd; pretlo_msg.Text = "Pretlo has " + Prtlo; race_btn.Enabled = false; nmPrice.Value = 0; Grany.Checked = false; Richard.Checked = false; Pretlo.Checked = false; Rambo_dog1.Checked = false; johny_dog3.Checked = false; jimmy_dog4.Checked = false; jacky_dog2.Checked = false; Grny = new Plyer("Grany", 0, 0, gany); richrd = new Plyer("Richard", 0, 0, Richrd); pretlo = new Plyer("Pretlo", 0, 0, Prtlo); }