Lifetime of objects in a collection in VB.Net

前端 未结 4 483
醉话见心
醉话见心 2021-01-15 16:42

I\'m trying to figure out the lifetime of the tmpTabPages in the following bit of code. Lets assume the form has an empty TabControl named MyTabControl, that there\'s a coll

4条回答
  •  星月不相逢
    2021-01-15 17:17

    You add only a reference of the TabPage object to the collection not the object TmpTabPage. The tmpTabPage object in this case you use it only for allocating memory.

提交回复
热议问题