This code specifically:
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
if (radioButton1.Checked)
{
label7.Text = man[0].Name; // Man[0] does not seem to exist from within this method.
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ADayAtTheraces
{
public partial class Form1 : Form
{
public Form1(){
InitializeComponent();
Guy[] man = new Guy[3];
man[0] = new Guy() { Name = "Joe", Cash = 50, MyBet = null, MyRadioButton = radioButton1 , MyLabel = label4};
man[1] = new Guy() { Name = "Bob", Cash = 75, MyBet = null, MyRadioButton = radioButton2, MyLabel = label5};
man[2] = new Guy() { Name = "Al", Cash = 45, MyBet = null, MyRadioButton = radioButton3, MyLabel = label6 };
for (int i = 0; i < man.Length; i++)
{
man[i].UpdateLabels();
}
{
}
Greyhound[] dog = new Greyhound[4];
dog[0] = new Greyhound() { MyPictureBox = pictureBox2, Location = pictureBox2.Location.X, RacetrackLength = racetrack.Size.Width};
dog[1] = new Greyhound() { MyPictureBox = pictureBox3, Location = pictureBox2.Location.X, RacetrackLength = racetrack.Size.Width };
dog[2] = new Greyhound() { MyPictureBox = pictureBox4, Location = pictureBox2.Location.X, RacetrackLength = racetrack.Size.Width };
dog[3] = new Greyhound() { MyPictureBox = pictureBox5, Location = pictureBox2.Location.X, RacetrackLength = racetrack.Size.Width };
}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
if (radioButton1.Checked)
{
label7.Text = man[0].Name;
}
}
}
}

New Topic/Question
Reply




MultiQuote




|