(Moderator: Thread moved to this forum for better responses)
Create controls at runtime.
Hi, I'm trying to create some buttons at runtime, what I'm trying to do is that the name of all the buttons will be stored in a database, and for each row in the table a button will be generated, however I don't know how to draw the buttons on runtime. Thanks in advance for your help.

Create controls at runtime.
gars1
Hi,S10n
If you want to display the button along with the other information from database, you can use a datagridview, add a DataGridViewButtonColumn into it,as:
DataGridViewButtonColumn btnCol = new DataGridViewButtonColumn();
btnCol.DataPropertyName = "Buttonname";
this.dataGridView1.Columns.Add(btnCol);
Hope it helps. Best Regards.
Ye
Oguz
Hi,
Here is a good example that adds buttons at runtime (using Winforms): http://www.c-sharpcorner.com/UploadFile/casperboekhoudt/AddingControlstoWindowsFormsatRuntime11282005061207AM/AddingControlstoWindowsFormsatRuntime.aspx
Greetz,
Geert
Geert Verhoeven
Consultant @ Ausy Belgium
My Personal Blog