Hi! everyone.
i have never learn to loop an groupbox or anything so i don't know what wrong but the compiler said "NullReferenceException was unhandle" and here is my code. Please help!
iNumberOfPassengers = CInt(txtAdult.Text)
gboPassengerDetails.Hide()
Dim gboNextPassenger(iNumberOfPassengers) As GroupBox
For iCounter As Integer = 2 To iNumberOfPassengers
gboNextPassenger(iCounter) = New GroupBox
Next
With gboNextPassenger(iCounter)
.Text = "Passenger Details - Adult number " & iCounter + 1.ToString
.Visible = True
.Left = 31
.Top = 348
.Size = New Size(651, 236)
End With