I have a set of dynamically created controls and cannot seem to close them to reset the parent control.
It looks like the .Close method cannot be called.
How can I work around this?
I have a set of dynamically created controls and cannot seem to close them to reset the parent control.
It looks like the .Close method cannot be called.
How can I work around this?
Cast them back?
Weblistbox(controlAt(index)).Close
Or use IsA in combination to check if the control matches
Thanks for the starting point. Here’s what I ended up doing:
ParentWebPage.ParentContainerControl1.idlist.AddRow( NewContainerControlRow.ControlID )
When it comes time to destroy the controls specified, I call this code:
While Me.ControlCount > 0 Var id1 As String id1 = ParentWebPage.ParentContainerControl1.idlist(0) ParentWebPage.ParentContainerControl1.idlist.RemoveRowAt(0) Me.ControlWithID(id1).Close Wend