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.

So, what’s the main behavior difference the Visual Basic 6.0 and Visual Basic .NET Controls collection?

0
Posted

So, what’s the main behavior difference the Visual Basic 6.0 and Visual Basic .NET Controls collection?

0

In Visual Basic 6.0, this collection contains all the controls that have been added to a particular Form, including controls that were added to other container controls such as PictureBox or Frame controls. In Visual Basic .NET, the Controls collection includes only the controls that were directly added to the control that owns the collection. For example, if a Form contains a Panel control that contains a Button control named button1, button1 will not be contained in the Controls collection that belongs to the Form. Instead of that, button1 will be contained in the panel’s Controls collection. As a consequence, iterating through the elements in a form’s Controls collection will not consider all the controls contained in the form, as it did in Visual Basic 6.0.

Related Questions

What is your question?

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

Experts123