J
jrhoads23
I have a custom list view "MyListView" (inherited from
System.Windows.Forms.ListView) which has a "Columns" property.
"Columns" if of type "MyColumnHeaderCollection" which is inherited from
System.Windows.Forms.ListView.ColumnHeaderCollection.
MyColumnHeaderCollection is a collection of "MyColumnHeader" objects
which are inherited from System.Windows.Forms.ColumnHeader.
I can go in the and add an instance of MyListView to a form and add
columns to it. In the InitializeComponent call, the List View is
created with the correct type (MyListView), the individual columns are
created with the correct type (MyColumnHeader), but the AddRange call
defines the columns as System.Windows.Forms.ColumnHeader() and not
MyColumnHeader().
What am I doing wrong or missing to get the AddRange call to use the
correct type???
Below is a snip from the automatically generated InitializeComponent
function...
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.ListView1 = New MyListView
Me.ColumnHeader1 = New MyColumnHeader
Me.ColumnHeader2 = New MyColumnHeader
'
'ListView1
'
Me.ListView1.Columns.AddRange(New
System.Windows.Forms.ColumnHeader()
{Me.ColumnHeader1, Me.ColumnHeader2})
Me.ListView1.Location = New System.Drawing.Point(100, 200)
Me.ListView1.Name = "ListView1"
Me.ListView1.TabIndex = 5
End Sub
System.Windows.Forms.ListView) which has a "Columns" property.
"Columns" if of type "MyColumnHeaderCollection" which is inherited from
System.Windows.Forms.ListView.ColumnHeaderCollection.
MyColumnHeaderCollection is a collection of "MyColumnHeader" objects
which are inherited from System.Windows.Forms.ColumnHeader.
I can go in the and add an instance of MyListView to a form and add
columns to it. In the InitializeComponent call, the List View is
created with the correct type (MyListView), the individual columns are
created with the correct type (MyColumnHeader), but the AddRange call
defines the columns as System.Windows.Forms.ColumnHeader() and not
MyColumnHeader().
What am I doing wrong or missing to get the AddRange call to use the
correct type???
Below is a snip from the automatically generated InitializeComponent
function...
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.ListView1 = New MyListView
Me.ColumnHeader1 = New MyColumnHeader
Me.ColumnHeader2 = New MyColumnHeader
'
'ListView1
'
Me.ListView1.Columns.AddRange(New
System.Windows.Forms.ColumnHeader()
{Me.ColumnHeader1, Me.ColumnHeader2})
Me.ListView1.Location = New System.Drawing.Point(100, 200)
Me.ListView1.Name = "ListView1"
Me.ListView1.TabIndex = 5
End Sub