Here is the code below im sure there is a simple way of doing it, but I am new to this and struggling. How can I let the textBoxLatitude.Text show items[0]?
namespace GPSCalculator
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
List<float> inputList = new List<float>();
TextReader tr = new StreamReader("c:/users/tom/documents/visual studio 2010/Projects/DistanceCalculator3/DistanceCalculator3/TextFile1.txt");
String input = Convert.ToString(tr.ReadToEnd());
String[] items = input.Split(',');
}
private void buttonNext_Click(object sender, EventArgs e)
{
textBoxLatitude.Text = (items[0]);
}
}
}
Move items array to class field.
Also I believe you want to show next item on each button click. Then you also need field for item index.