The question is is ill-posed: a list item, it it even exist, is some object. It does exist and, hence, always has a value. It depends on what do you mean by "value", because there are value types and reference types, but, from the point of your of the
ListBox
, this is an object of the type
System.Object
, which implies that the item reference something.
Again, it depends on what do you mean by "value". Apparently, you work with strings which you interpret as integers. Then you can consider empty string as "not a value", or, more generally, if
decimal.TryParse(string, out decimal)
returns false, you can consider this as "not a value". Please see:
http://msdn.microsoft.com/en-us/library/9zbda557%28v=vs.110%29.aspx[
^].
However, the whole approach is wrong.
You should not work with strings representing data instead of data itself.
ListBox
elements could be of any type, and you should use this fact by storing actual data in it. This is explained in detail in my past answer:
combobox.selectedvalue shows {} in winform[
^].
Don't use strings representing data where you need the data itself.
—SA