[RESOLVED] Check Box Array....help
I know that VB.NET no longer supports arraying of controls, how-ever I found a few threads here on the forum pertaining to ways around this. I tried a few of them, and I cant seem to get it to work correctly. It seems to work, however I cant seem to make them visible. Anyone know what I'm doing wrong?
Code:
Public Class Form1
Private chekbox(10) As CheckBox
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
For i = 1 To 10
chekbox(i) = New CheckBox()
chekbox(i).Visible = True
chekbox(i).Left = i
chekbox(i).Top = i
Next
End Sub
End Class
This should show the boxes, just super-imposed on one another. However it doesnt. Any clue?
Re: Check Box Array....help
vb Code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button2.Click
For i As Integer = 1 To 10
chekbox(i) = New CheckBox()
Me.Controls.Add(chekbox(i))
chekbox(i).Visible = True
chekbox(i).Left = i
chekbox(i).Top = i
Next
End Sub