title: Creating new UI controls programmatically in visual c++
body: <p>I have just started using visual studio c++ (2010) with windows forms, but have cannot for the life of me find out how to create new UI items in response to events. What I would want to happen is click a button, and have a new row, with a couple of text boxes and buttons appear, with onebutton to delete the row if I keep clicking, more rows will appear, named row0, row1 etcv. I looked at this page, (<a href="http://msdn.microsoft.com/en-us/library/aa984255(v=vs.71).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/aa984255(v=vs.71).aspx</a>), about adding controls programmatically, but when I add a new text box inside a click event, the text box is only created inside the scope of the event (as expected!), but I want to be able to create it insde the newRow click event, but access it and . I thought of making a 'row' class, with row.text and row.deleteButton properties, and at each creation of a row, respective events will be created for button clicks and text edits.</p>
  
  <p>Is there anyway to do this, ie a function that can be created that creates new objects by passing the required name?</p>