"YXQ" <YX*@discussions.microsoft.coma écrit dans le message de news:
6C**********************************@microsoft.com...
>I have set the names of each column on design-time, but the code below
could
not get their names, why? thank you.
////////////////////////////////////////////////////////////////////////
For Each EachColumnHeader As ColumnHeader In ListView1.Columns
MessageBox.Show(EachColumnHeader.Name)
Next
Strangely it would appear that column header names defined at design time
are not accessible at run-time.
However if you do this
dim header1 as columnheader
header1= new columnheader
header1.text ="My Title"
header1.name="MyColumn1"
listview1.columns.add(header1)
then the name is accessible