I have a table with a list of program names in the first column. When a button (left-hand side of the form) is pressed, i would like buttons to appear down the right-hand side of the form with the program names on them.
I have this effect at present by having 20 buttons on the right-hand side with their visible property set to No.
When the left-hand side button is pressed, i set a SQL recordset and make each button visible, and asign a caption in turn.
However, the inevitable has happened - The program list has now reached 21. Instead of simply creating more buttons i would like to create each button required in VB (meaning that you can have an infinite amount on the list). Using the CreateControl function, the form has to be in design mode which stops the code from running.
I have tried creating the control in a module passed to by the form but this won't work either. Can anyone help?
If this is really confusing, let me know!
Make your choices on another form and when the user clicks the button, then open the other form in the desigen format, add all your desired buttons 21, or 29 then close it and open it normally (run format)