Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

The controls that Ive try to add to my form at runtime don show up. Whats wrong?

controls form runtime Try wrong
0
Posted

The controls that Ive try to add to my form at runtime don show up. Whats wrong?

0

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

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123