ISupportInitialize Interfejs

Definicja

Określa, że ten obiekt obsługuje proste, transakcyjne powiadomienie na potrzeby inicjowania wsadowego.

public interface class ISupportInitialize
public interface ISupportInitialize
type ISupportInitialize = interface
Public Interface ISupportInitialize
Pochodne

Przykłady

W poniższym przykładzie kodu pokazano, jak za pomocą interfejsu ISupportInitialize zainicjować trzy TrackBar kontrolki.

(dynamic_cast<System::ComponentModel::ISupportInitialize^>(this->trackBar1))->BeginInit();
(dynamic_cast<System::ComponentModel::ISupportInitialize^>(this->trackBar2))->BeginInit();
(dynamic_cast<System::ComponentModel::ISupportInitialize^>(this->trackBar3))->BeginInit();
this->SuspendLayout();

// 
// trackBar1
// 
this->trackBar1->Location = System::Drawing::Point( 160, 400 );
this->trackBar1->Name = "trackBar1";
this->trackBar1->TabIndex = 1;
this->trackBar1->Scroll += gcnew System::EventHandler( this, &Form1::trackBar_Scroll );

// 
// trackBar2
// 
this->trackBar2->Location = System::Drawing::Point( 608, 40 );
this->trackBar2->Name = "trackBar2";
this->trackBar2->TabIndex = 2;
this->trackBar2->Scroll += gcnew System::EventHandler( this, &Form1::trackBar_Scroll );

// 
// trackBar3
// 
this->trackBar3->Location = System::Drawing::Point( 56, 40 );
this->trackBar3->Name = "trackBar3";
this->trackBar3->TabIndex = 3;
this->trackBar3->Scroll += gcnew System::EventHandler( this, &Form1::trackBar_Scroll );
(dynamic_cast<System::ComponentModel::ISupportInitialize^>(this->trackBar1))->EndInit();
(dynamic_cast<System::ComponentModel::ISupportInitialize^>(this->trackBar2))->EndInit();
(dynamic_cast<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.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();
CType(Me.trackBar1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.trackBar2, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.trackBar3, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'trackBar1
'
Me.trackBar1.Location = New System.Drawing.Point(160, 400)
Me.trackBar1.Name = "trackBar1"
Me.trackBar1.TabIndex = 1
'
'trackBar2
'
Me.trackBar2.Location = New System.Drawing.Point(608, 40)
Me.trackBar2.Name = "trackBar2"
Me.trackBar2.TabIndex = 2
'
'trackBar3
'
Me.trackBar3.Location = New System.Drawing.Point(56, 40)
Me.trackBar3.Name = "trackBar3"
Me.trackBar3.TabIndex = 3
CType(Me.trackBar1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.trackBar2, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.trackBar3, System.ComponentModel.ISupportInitialize).EndInit()

Uwagi

ISupportInitialize umożliwia kontrolkom optymalizowanie wielu przypisań właściwości. W związku z tym można zainicjować współzależne właściwości lub wsadowe ustawić wiele właściwości w czasie projektowania.

Wywołaj metodę BeginInit , aby zasygnalizować obiekt, który rozpoczyna inicjowanie. Wywołaj metodę EndInit , aby zasygnalizować ukończenie inicjowania.

Metody

BeginInit()

Sygnalizuje rozpoczęcie inicjowania obiektu.

EndInit()

Sygnalizuje ukończenie inicjowania obiektu.

Dotyczy

Zobacz też