views:

647

answers:

2

Hello All!

Could someone please explain what the difference is between using the ISupportInitialize interface methods (BeginInit/EndInit) and using SuspendLayout/ResumeLayout?

Is ISupportInitialize ONLY used during construction/"initial" initialization... or can it be used later when you want to add new child controls to an existing parent control?

Any particular differences?

I greatly appreciate your help!

Thank you,

Pato

A: 

The interface ISupportInitialize lives in the System.dll and is just a fairly generic concept in the realm of Components. Incidentally, many parts of System.Windows.Forms are Components, and also Windows.Forms is the main user of the ComponentModel stuff.

Suspend/ResumeLayout is a pure Windows.Forms thing and really telling a control to not try and do graphics while you are e.g. adding child controls or changing properties.

flq
A: 

hi.

iam facing a problem. we are using thirdparty acive x control in a c# user control. when running from one of our application , application hangs at endinit call of the control. directly running from vs2005 doesnt seem to cause any problem and was able to load the control successfully. our application is a com based application. any help will be greatly appreciated.

apps