len ja tie checkboxy pridavam dynamicky, cize na zaciatku neviem presne ani ich pocet ani napr. ich nazvy. proste ich tvorim takto
Dim con As New OleDbConnection(pripojovaci_retazec)
Dim com As New OleDbCommand("SELECT * FROM ciselnikSkupina WHERE vlastnikAutoskola = true", con)
Dim i As Integer
Dim x As Integer = 100
Dim nazov As String
con.Open()
Dim dataReader As OleDbDataReader = com.ExecuteReader
Do While dataReader.Read ' posun na dalsie riadky, pokial su k dispozicii
Dim checkBox As CheckBox = New CheckBox
i = dataReader("id")
nazov = dataReader("skupina")
Me.Controls.Add(checkBox)
checkBox.Name = "checkBox" & i
checkBox.Text = nazov
checkBox.Location = New Point(500, x)
x = x + 50
Loop
dataReader.Close()
con.Close()
|