En arrière-plan, les codes de la mise en page sont générés pour vous. Vous pouvez vérifier le code dans le fichier myfile.designer.cs
L'image ci-dessous montre une mise en page dans Visual Studio :
- A gauche : les contrôles de mise en page
- à droite : exemple de FlowLayout comme vous l'avez en Java
![enter image description here]()
En regardant le code, vous avez généré ces éléments pour le flowlayout. Vous pouvez donc faire d'autres contrôles comme celui-ci et apprendre comment ils sont générés.
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.flowLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.Controls.Add(this.button1);
this.flowLayoutPanel1.Controls.Add(this.button2);
this.flowLayoutPanel1.Controls.Add(this.button3);
this.flowLayoutPanel1.Controls.Add(this.button4);
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.LeftToRight;
//Other directions: BottomUp, RightToLeft, TopDown
this.flowLayoutPanel1.Location = new System.Drawing.Point(12, 42);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(200, 71);
this.flowLayoutPanel1.TabIndex = 0;
Mais le designer vous fera gagner du temps.