I have the following code, how can I get the values from the items in the listbox and get my program to find the average, highest and lowest of the values. I currently have the following textboxes (averageTextbox, highestTextbox, lowestTextbox) and I wish to display the values accordingly into the textboxes. Thanks in Advance!
private void readButton_Click(object sender, EventArgs e)
{
int counter = 0;
string line;
System.IO.StreamReader file = new System.IO.StreamReader(
@"C:\Users\Harra\Documents\Visual Studio 2017\Projects\File Reader\Sales.txt");
double dblAdd = 0;
while ((line = file.ReadLine()) != null)
{
displayListBox.Items.Add(line);
dblAdd += Convert.ToDouble(line);
counter++;
}
totalTextBox.Text = string.Format("{0:F}", dblAdd);
}