I am making a program where I need to dynamically add buttons to a form. When the form loads anywhere from 0-30 buttons will need to be loaded. When a button is pressed it needs to run a common function, but pass a unique parameter to the function so it knows what button was pressed. I have looked on the internet and I have found ways to add buttons during run time, but they always have to predetermined before the program is complied.
Here is an example of what i want my program to do.
On load
create a button for each id# in an array
when that button is pressed it passes that id# to a function as a parameter.
Thanks in advance