string url = objectListView1.Invoke(new Action(() =>
objectListView1.
SelectedItems[objectListView1.SelectedIndex].
SubItems[7].Text));
Action
delegate doesn't return any result. If you want to return string
, then you need to use Func<string>
:
string url = objectListView1.Invoke(new Func<string>(() =>
objectListView1.
SelectedItems[objectListView1.SelectedIndex].
SubItems[7].Text)) as string;