I have this code to get around the bane of everyone's existence
delegate int GetSelectedIndicesCountCallback(ListBox thing);
private int GetSelectedIndicesCount(ListBox thing)
{
if (this.InvokeRequired)
{
GetSelectedIndicesCountCallback d = new GetSelectedIndicesCountCallback(GetSelectedIndicesCount);
Invoke(d, new object[] { thing });
}
else
{
return thing.SelectedIndices.Count;
}
return 0;
}
The return 0 being there because it'd error without it. However, it always returns 0. I don't know how to get it to return the other value.