Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / January 2005

Tip: Looking for answers? Try searching our database.

Control Addition safety handling

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
joeycalisay - 03 Jan 2005 05:49 GMT
I was curious about the following scenario but couldn't find the exact
handling using disassembler:

What happens if an instance of a control already added in the Controls
collection of a form is added again?  Is there a reference check on each
control addition to handle the said scenario?

It is possible that there is a reference checking since the OnControlAdded
event is not raised for the second time.  Anyone who can shed some light on
the said handling?  Thanks a lot!
Herfried K. Wagner [MVP] - 03 Jan 2005 11:30 GMT
"joeycalisay" <hcalisay@_spamkiller_codex-systems.com> schrieb:
> What happens if an instance of a control already added in the Controls
> collection of a form is added again?  Is there a reference check on each
[quoted text clipped - 4 lines]
> on
> the said handling?  Thanks a lot!

Yes, the 'Controls' collection checks if the control has already been added
and then adds the control only if it's not already in the collection.

Signature

M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.