Hi guys, I have a problem and would appreciate some guidance.
The problem I have is that on my design screen I have 5 progress bars (progressBarHour1,2,3,4,5) and also have an array with a size of [4] as seen below.
I would like the array to store values given by a weather reciever that takes data from a .dll and stores it in the array which works, but now how I'd like.
What I would like is for the array to store the rainfall (weatherSender.Rainfall) in the index of the array {here,here,here,here,here}, and store a new amount of rainfall again in [1,2,3,4], and so on untill the array is filled. I know my coding is messy, but I don't know how to have it store the data for a seperate occasion in each new index of the array. Sorry if none of this makes sense, I'll try and word it better if you don't understand.
Thanks.
private void precipArrayClass()
{
precipArray = new int[4] {weatherSender.Rainfall,weatherSender.Rainfall,weatherSender.Rainfall,weatherSender.Rainfall,weatherSender.Rainfall}; //declaring the array to hold ints and has a size of 13
if (labelRaining.Text != "False") // if the labels text is not equal to false do the following..
{
labelPrecip.Visible = true; //make this label visibile
labelInfoPrecipPerHour.Visible = true; //make this label visible
labelPrecip.Text = weatherSender.Rainfall.ToString() + " mm"; //using the weather sender take the current rainfall and store it in labelPrecip
}
if (labelInfoPrecipPerHour.Visible == false)
{
progressBarHour1.Value = 0;
progressBarHour2.Value = 0;
progressBarHour3.Value = 0;
progressBarHour4.Value = 0;
progressBarHour5.Value = 0;
}
else
{
progressBarHour1.Value = precipArray[0];//display value of position in array
progressBarHour2.Value = precipArray[1];//display value of position in array
progressBarHour3.Value = precipArray[2];//display value of position in array
progressBarHour4.Value = precipArray[3];//display value of position in array
progressBarHour5.Value = precipArray[4];//display value of position in array
}