Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Switching UserControl at runtime
Message
From
29/01/2011 18:09:46
 
 
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01497625
Message ID:
01497799
Views:
48
>>>If the UserControls are added at design time I don't think they will go out of scope when they are moved from the Controls collection.
>>
>>Pete said he was adding to the TabPage programmatically, but I don't know how he instantiated them in the first place.
>
>But even if they were instantiated programatically, all that is required is a reference that is locally scoped to the form....


Yes, that's correct. I guess one of the things I had been thinking about when I replied, was some of the dynamic instantiation I used to do at a past company, using Reflection to load and display various UserControls in a Panel ... kind of an Outlook-style of design using SideBars on the left side and the Panel with the UserControl on the right. We never kept any references to the UserControl once we switched to another, but that design was way different than what Pete was talking about with TabPages.

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform