Hey ! Whats wrong with this code? It gives me this error: Additional information: Object reference not set to an instance of an object. It gives me the error at this line:Code:rb(1) = New RadioButton()Code:Dim rb As List(Of RadioButton) = Nothing Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load rb(1) = New RadioButton() rb(2) = New RadioButton() rb(3) = New RadioButton() rb(4) = New RadioButton() rb(1).Location = vb1.Location rb(2).Location = vb2.Location rb(3).Location = vb3.Location rb(4).Location = vb4.Location For i As Integer = 1 To 4 My.Forms.Form1.Controls.Add(rb(i)) Next End Sub
Thank you very much guys, I need this for a projekt to school![]()




Reply With Quote
