The controls that Ive try to add to my form at runtime don show up. Whats wrong?
Make sure you implemented and executed code similar to the InitializeComponent method that VS adds to your Windows Forms project for controls added during design time. Recall that InitializeComponent() is called from your Forms constructor to create the controls, size, position and show the controls, and finally add the controls to the form’s Controls collection. So, your code at runtime should also implement these same steps. In particular, don’t forget the this.Controls.AddRange call that adds your new controls to the form’s Controls collection.
Related Questions
- I have select the wrong product name/grammage/size/brand/quantity in my order form. How can I change/edit/delete the order?
- When I open PDFs generated by the Smart-Pay system or try to print them they are blank. Whats wrong?
- The controls that Ive try to add to my form at runtime don show up. Whats wrong?