ColumnHeaderCollection

  • Thread starter Thread starter AnonMan
  • Start date Start date
A

AnonMan

I have a function Called HeaderCol() that builds up and
returns a Column Header Collection.

How do I assign this to my listview in my calling
function ?

Thanks
 
AnonMan said:
I have a function Called HeaderCol() that builds up and
returns a Column Header Collection.

How do I assign this to my listview in my calling
function ?

You don't have to assign it because you have to pass the Listview to the
constructor of the ColumnHeaderCollection.
 
Armin Zingler said:
You don't have to assign it because you have to pass the Listview to
the constructor of the ColumnHeaderCollection.

....which means that the ColumnHeaderCollection is automatically assigned to
the Listview.
 
Thanks,

Supposing I have an array of column headers I want to
assign to the listview:

I currently use

for icount = 0 to ubound(myarray)
ListView1.Columns.Add(myarray
(iCount).ToString, 100, HorizontalAlignment.Left)
next icount

I was curious if I could have a function that builds up
any set of columns and return/assign them to any
new listview I create in the form of a column collection.
 
AnonMan said:
Thanks,

Supposing I have an array of column headers I want to
assign to the listview:

I currently use

for icount = 0 to ubound(myarray)
ListView1.Columns.Add(myarray
(iCount).ToString, 100, HorizontalAlignment.Left)
next icount

I was curious if I could have a function that builds up
any set of columns and return/assign them to any
new listview I create in the form of a column collection.


Pass the listview to the function as an argument. In the function, pass the
listview to the constructor of the ColumnHeaderCollection.
 
Back
Top