I get an error in my code:
Cross-thread operation not valid: Control 'listBox1' accessed from a thread other than the thread it was created on
Code:
 private void button2_Click(object sender, EventArgs e)
 {
     Thread t1 = new Thread(mult);
     t1.Start();
 }
 public void mult()
 {
     FileStream fq = new FileStream(textBox1.Text, FileMode.OpenOrCreate, FileAccess.Read, FileShare.ReadWrite);
     StreamReader s = new StreamReader(fq);
     while (!s.EndOfStream)
     {
         Thread.Sleep(500);
         listBox1.Items.Add(s.ReadLine()); //error at this line
     }
     s.Close();
 
     
     
    