Export (0) Print
Expand All

ISupportInitialize Interface

Specifies that this object supports a simple, transacted notification for batch initialization.

Namespace: System.ComponentModel
Assembly: System (in system.dll)

public interface ISupportInitialize
public interface ISupportInitialize
public interface ISupportInitialize
Not applicable.

ISupportInitialize allows controls to optimize multiple property assignments. As a result, you can initialize co-dependent properties or batch set multiple properties at design time.

Call the BeginInit method to signal the object that initialization is starting. Call the EndInit method to signal that initialization is complete.

The following code example demonstrates how to use the ISupportInitialize interface to initialize three TrackBar controls.

((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.trackBar2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.trackBar3)).BeginInit();
this.SuspendLayout();
// 
// trackBar1
// 
this.trackBar1.Location = new System.Drawing.Point(160, 400);
this.trackBar1.Name = "trackBar1";
this.trackBar1.TabIndex = 1;
this.trackBar1.Scroll += new System.EventHandler(this.trackBar_Scroll);
// 
// trackBar2
// 
this.trackBar2.Location = new System.Drawing.Point(608, 40);
this.trackBar2.Name = "trackBar2";
this.trackBar2.TabIndex = 2;
this.trackBar2.Scroll += new System.EventHandler(this.trackBar_Scroll);
// 
// trackBar3
// 
this.trackBar3.Location = new System.Drawing.Point(56, 40);
this.trackBar3.Name = "trackBar3";
this.trackBar3.TabIndex = 3;
this.trackBar3.Scroll += new System.EventHandler(this.trackBar_Scroll);
((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.trackBar2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.trackBar3)).EndInit();

((System.ComponentModel.ISupportInitialize)this.trackBar1).BeginInit();
((System.ComponentModel.ISupportInitialize)this.trackBar2).BeginInit();
((System.ComponentModel.ISupportInitialize)this.trackBar3).BeginInit();
this.SuspendLayout();
// 
// trackBar1
// 
this.trackBar1.set_Location(new System.Drawing.Point(160, 400));
this.trackBar1.set_Name("trackBar1");
this.trackBar1.set_TabIndex(1);
this.trackBar1.add_Scroll(new System.EventHandler(this.trackBar_Scroll));
// 
// trackBar2
// 
this.trackBar2.set_Location(new System.Drawing.Point(608, 40));
this.trackBar2.set_Name("trackBar2");
this.trackBar2.set_TabIndex(2);
this.trackBar2.add_Scroll(new System.EventHandler(this.trackBar_Scroll));
// 
// trackBar3
// 
this.trackBar3.set_Location(new System.Drawing.Point(56, 40));
this.trackBar3.set_Name("trackBar3");
this.trackBar3.set_TabIndex(3);
this.trackBar3.add_Scroll(new System.EventHandler(this.trackBar_Scroll));
((System.ComponentModel.ISupportInitialize)this.trackBar1).EndInit();
((System.ComponentModel.ISupportInitialize)this.trackBar2).EndInit();
((System.ComponentModel.ISupportInitialize)this.trackBar3).EndInit();

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0

XNA Framework

Supported in: 1.0

Community Additions

ADD
Show:
© 2014 Microsoft