C#:
//The "while" below cause and exception:
//System.InvalidOperationException:'Cross-thread operation not valid: Control lstFiles accessed from thread other than the thread it was created on.'
private void watchFinished()
{
do
{
Thread.Sleep(50);
}
while (lstFiles.CheckedItems.Count != 0);
showProgress(prgHole, 100);
string ans = "Done";
if (undeletable.Count != 0)
{
string[] items = new string[undeletable.Count];
undeletable.CopyTo(items, 0);
frmUndeletable frm = new frmUndeletable(items);
frm.ShowDialog();
}
else
ans += ", No Items TO Delete";
MessageBox.Show(ans + " : " + prg.ToString() + " files deleted");
}
Please bear with me, I don't write C# but I have a C# program that I need and it gives the error mentioned above.
I have no need to learn C# but I do need the program and would appreciate it if you would tell me how to fix it.
If I didn't give enough info above, maybe you can just give me something to try.
In any event, I'd appreciate any help at all.