This is baffling me, maybe somebody can shine the light of education on my ignorance. This is in a C# windows app. I am accessing the contents of a listbox from a thread.
You're trying to write to a control from a thread other than the main thread. Use Invoke or BeginInvoke.
void SetMax() { if (prgAll.InvokeRequired) { prgAll.BeginInvoke(new MethodInvoker(SetMax)); return; } prgAll.Maximum = lbFolders.SelectedItems.Count; }