Hello,
I have a listView on my form.I want to add stuff to it durring the program is running.
This is the code I use
public void FillList(string[] Name,int[] empty,int[] Population,int[] Max,int[] Check,int size)
{
if (this.InvokeRequired)
{
this.Invoke((MethodInvoker)delegate
{
for (int i = 0; i < size; i++)
{
ListViewItem item = new ListViewItem(Name[i]);
item.SubItems.Add(empty[i].ToString); //error
item.SubItems.Add(Population[i].ToString); //error
item.SubItems.Add(Max[i].ToString); //error
if (Check != 1)
item.SubItems.Add("No");
else
item.SubItems.Add("Yes");
listView1.Items.Add(item);
}
});
}
}
the parameter must be string and I tried .ToString,but I get this:
Argument '1': cannot convert from 'method group' to 'string'