Hey,
I have a multiform program. On one form, i wish to return a ListViewItem, to the callling form, but ONLY if an instance of the class was made (i.e. only if the object exists).
It goes like this...
Top of code in secondary form:
ListViewItem myItem;
...
public ListViewItem GetItem()
{
if (myItem != null)
return myItem;
else
return null;
}
Later on in the code of the secondary form:
void ButtonAddClick(object sender, System.EventArgs e)
{
myItem = new ListViewItem();
//myItem no longer = null, so will return when form is OK'd (via the OK button)
}
Is something like this possible Please help :)
Cheers,
Jonathan

Checking if an object exists before returning?
TOM A.
i've managed to get the effect i wanted, using the same method you mentioned. Embarrasingly, it was my poor coding and not that it was difficult to implement. Thank you for the quick response.
Lowell M
How do you want it to behave when the item hasn't been created
You could just as well write that as
public ListViewItem GetItem()
{
return myItem;
}