Sunday, February 17, 2013

Create controls at run time with events

This code demonstrates how to add controls to a form at run time. The number of rows and columns, the spacing between the controls and the size of the controls are all determined by Consts, but this could easily be changed so that the parameters are user entered. My example adds two handlers to each textbox. I will be posting a refinement to this that uses a TableLayoutPanel to position the controls.

No comments:

Post a Comment