J
Jim Heavey
I amd playing around with inheritance a little in VB.Net
If I create a new class which inherits from ListViewItem and I am only
wanting to override the ToString Method. In this situation, If I only
override the "ToString" method, I find that I only have a single
constructor. Do I have to clone all of the constructor methods and then
execute the MyBase.New(....) methods for each of those constructors? If I
am inheriting all methods and data, why would I have to re-create these
methods.
When I create an instance of this new class, it seems to create the new
class just fine, but when I go to add that object into my combobox I get a
"Object reference not set to an instance of an object." My code looks like
the following...
Dim item As New SpListViewItem(items(indx))
cboFormatType.Items.Add(item)
My "item" is populated as I expected, so I do not understand the error.
Any idea?
Thanks in advance for your assistance!!!!!!!!
If I create a new class which inherits from ListViewItem and I am only
wanting to override the ToString Method. In this situation, If I only
override the "ToString" method, I find that I only have a single
constructor. Do I have to clone all of the constructor methods and then
execute the MyBase.New(....) methods for each of those constructors? If I
am inheriting all methods and data, why would I have to re-create these
methods.
When I create an instance of this new class, it seems to create the new
class just fine, but when I go to add that object into my combobox I get a
"Object reference not set to an instance of an object." My code looks like
the following...
Dim item As New SpListViewItem(items(indx))
cboFormatType.Items.Add(item)
My "item" is populated as I expected, so I do not understand the error.
Any idea?
Thanks in advance for your assistance!!!!!!!!