// [B]DirMgr.cs[/B]
void Scan()
{
while (scanFlag == true)
{
List<string> recentList = new List<string>();
FetchList(scanDir, recentList);
contentList = recentList;
form1.setText(contentList);
Thread.Sleep(scanDelay);
}
}
// [B]Form1.cs[/B]
public void setText(List<string> contents)
{
[COLOR="Red"]richTextBox1.AppendText("\n--------------------");[/COLOR]
foreach (string str in contents)
richTextBox1.AppendText("\n" + str);
}
on the red line i get the following runtime-error{"Cross-thread operation not valid: Control 'richTextBox1' accessed from a thread other than the thread it was created on."}
Please help ASAP


Sign In
Create Account

Back to top









