M
Miesha.James
Hello,
I've added a list view to a windows form and I want to add items and
subitems to the list at runtime. The problem that I have is that when
I try to use the list view control variable it throws the following
error
An unhandled exception of type 'System.NullReferenceException'
occurred in RcvrStatusTest.exe
Additional information: Object reference not set to an instance of an
object.
I created the list view control by using the design wizard. So, I
used the variable the was generated by the design wizard.
(exception thrown here) ListView1 = gcnew ListView(); (If I were to
comment out this line the exception will be thrown on the next line
that contains ListView1)
(Here)ListViewItem^ lviName= ListView1->Items->Add("Michael
Beasley");
lviName->SubItems->Add("101 Lance Court");
lviName->SubItems->Add("000-000-0000");
Does anyone have any suggestions?
I've added a list view to a windows form and I want to add items and
subitems to the list at runtime. The problem that I have is that when
I try to use the list view control variable it throws the following
error
An unhandled exception of type 'System.NullReferenceException'
occurred in RcvrStatusTest.exe
Additional information: Object reference not set to an instance of an
object.
I created the list view control by using the design wizard. So, I
used the variable the was generated by the design wizard.
(exception thrown here) ListView1 = gcnew ListView(); (If I were to
comment out this line the exception will be thrown on the next line
that contains ListView1)
(Here)ListViewItem^ lviName= ListView1->Items->Add("Michael
Beasley");
lviName->SubItems->Add("101 Lance Court");
lviName->SubItems->Add("000-000-0000");
Does anyone have any suggestions?