Prova questo codice:
Public Sub Form_Open()
Dim aHeaders As String[] = ["PIPPO", "PLUTO", "TOPOLINO", "MINNIE"]
Dim hGrid As GridView
hGrid = New GridView(Me) As "GridView1"
With Me
.H = 512
.W = 512
.Arrangement = Arrange.Fill
.Margin = True
End With
With hGrid
.AutoResize = True
.Header = GridView.Horizontal
.Rows.Count = 10
.Columns.Count = aHeaders.Count
.Columns[0].Width = 10
End With
For i As Integer = 0 To aHeaders.Max
hGrid.Columns[i].Title = aHeaders[i]
hGrid.Columns[i].Expand = True
Next
hGrid.Columns[1].Width = -1
End
Public Sub GridView1_ColumnResize(Column As Integer)
Print "RESIZE "; Column
End
Public Sub GridView1_ColumnSize(Column As Integer)
Print "SIZE "; Column
End
:ciao:
Io invece ho notato che l'Evento "_ColumnSize()" si scatena solo se nella prima routine:
hGrid.Columns[1].Width = -1
Se viene posto un valore uguale o maggiore di zero, l'Evento non si solleva.