I am developing an application related to display screen at Airports. For that purpose, I intend listbox UI controller to the display that includes Flight information, like (Flight#, Destination, Status). I wish to include the functionality so that an automatic change of status takes place after some specified time. For example, after 10 minutes, Check-In gets changed to Boarding and after 10 more minutes, boarding gets changed to Ready-To-Takeoff.
I am reading the data from file and adding strings into listbox as individual flight details as: PK101 London Check-In. On button click event, file is read and flight data is added to listbox as string rows. However, I am unable to implement, status can change its value.
void addFlights()
{
string[]
lines=File.ReadAllLines(@"D:\FlightsSchedule\flights.txt");
foreach (string line in lines)
{
listBox1.Items.Add(line);
Thread.Sleep(500);
}
}
private void button1_Click(object sender, EventArgs e)
{
Thread thrd=new Thread(addFlights);
thrd.Start();
}
On the basis of certain time (System generated), status on listbox may get changed as: Flight Destination Status
After chek-in: PK102 KHI boarding
After Boarding:TK103 London Take-Off