Lire en anglais

Partager via


ISupportInitialize Interface

Définition

Spécifie que cet objet prend en charge une notification simple traitée avec transaction pour l'initialisation batch.

C#
public interface ISupportInitialize
Dérivé

Exemples

L’exemple de code suivant montre comment utiliser l’interface ISupportInitialize pour initialiser trois TrackBar contrôles.

C#
((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();

Remarques

ISupportInitialize permet aux contrôles d’optimiser plusieurs affectations de propriétés. Par conséquent, vous pouvez initialiser des propriétés co-dépendantes ou définir plusieurs propriétés par lots au moment du design.

Appelez la BeginInit méthode pour signaler à l’objet que l’initialisation démarre. Appelez la EndInit méthode pour signaler que l’initialisation est terminée.

Méthodes

BeginInit()

Signale à l'objet que l'initialisation démarre.

EndInit()

Signale à l'objet que l'initialisation est terminée.

S’applique à

Produit Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

Voir aussi