I have two functions:
int GetRowCount()
{
return lvComponent.Items.Count;
}
string GetCellText(int row, int col)
{
return lvComponent.Items[row].SubItems[col].Text;
}
lvComponent is a ListView control.
I call both of them from another thread using Invoke.
The first one works perfectly.
The second one throws an exception saying that you can't access controls from a different thread.
How come the first one works and the second doesn't. The way I call Invoke follows the standard method described in numerous web articles.