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 / Design Time / December 2004

Tip: Looking for answers? Try searching our database.

Reliable way to determine after all properties were set?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
WXS - 10 Dec 2004 03:57 GMT
Is there a reliable place where I can do some work after all of the
properties have been set?

Controls/Components that need to know when all properties have been set
need to use ISupportInitialize BeginInit, EndInit and use the EndInit call
BUT Begin and EndInit are never called when the component is first dropped on
to the form, making this an unreliable method to use for design mode.

Thanks,
Dave
joeycalisay - 10 Dec 2004 08:17 GMT
What exactly are you trying to do?

The OnLoad eventhandler of the Form is the only way I can think where you
can do some routine after the execution of the InitializeComponent where all
properties of controls used are set.  DesignMode is frequently used as test
at this virtual method.

> Is there a reliable place where I can do some work after all of the
> properties have been set?
[quoted text clipped - 6 lines]
> Thanks,
> Dave
WXS - 10 Dec 2004 20:55 GMT
It seems Begin/EndInit was for this purpose but does not work the first time
the control is dropped on the form (Which it should). My object is a
component that sits on the form so can't use the form load as I may not be
the one writing the form, someone may just drop my component on their form.  
I need to see after all properties are set if there are any
properties/components. that are no longer relevant that I can clean up.  I
keep references in the properties that match up to names of other components
in the component list.  I remove unreferenced components I add once I can
confirm they are no longer needed.  I could do this as the user edits things
but that could be time consuming compared to on designer load the user would
hardly even notice.

> What exactly are you trying to do?
>
[quoted text clipped - 14 lines]
> > Thanks,
> > Dave
joeycalisay - 13 Dec 2004 01:50 GMT
Have you tried the OnCreateControl for Control types or the OnLoad for
UserControl types?

> It seems Begin/EndInit was for this purpose but does not work the first time
> the control is dropped on the form (Which it should). My object is a
[quoted text clipped - 26 lines]
> > > Thanks,
> > > Dave

Rate this thread:







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.