I have the following code below that checks my database and then adds buttons to the FlowLayoutPanel. I want to limit the amount of buttons that fit on the flowlayoutpanel to 30 and then if there are more than 30 in the database add the others to flowpanellayout2.
I also want to add 3 buttons to the flowlayoutpanel at the end of my generated buttons how can I do this?
Dim con As New SqlConnection(My.Settings.Constr)
Dim cmd As New SqlCommand("SELECT * FROM tblCostumes WHERE master = '0'", con)
Dim reader As SqlDataReader = cmd.ExecuteReader()
Dim btn As New Button
btn.Name = "Button" & reader("id")
btn.Width = 116
btn.Height = 76
btn.Tag = reader("name")
btn.Text = reader("name")
AddHandler btn.Click, AddressOf GetProductDetails