I need to display the members of an array one-by-one into a label using thread. The thread needs to change the content every second. How could I achieve this?
My code is as follows:
private void Form1_Load(object sender, EventArgs e)
{
string[] heartRate = new String[] {"153","155","157","155","153","154"};
myThread display = new myThread();
display.hr = Array.ConvertAll(heartRate, num => Int32.Parse(num));
Thread threadHeartRate = new Thread(display.threadHeartrate);
}
public class myThread
{
private int[] _hr;
internal int[] hr {get { return _hr; } set { _hr = value; } }
public void threadHeartrate()
{
for (int i = 0; i < _hr.Length; i++)
{
}
}
}
The array I need to print is heartRate
.