Ich habe ein Problem mit einem FlowLayoutPanel und ich weiß nicht wie ich es lösen soll.Wie bekomme ich FlowLayoutPanel.AutoSize um mit FlowBreak zu arbeiten?
Ich platziere zwei FlowLayoutPanels in einem anderen; der zweite innere flp hat 3 Knöpfe innen.
Die Eigenschaften von Flowlayoutpanel Kind sind:
FlowDirection = LeftToRight;
AutoSize = true;
AutoSizeMode = GrowAndShrink;
WrapContents = true;
Jetzt stelle ich für jede Taste, um die FlowBreak
Eigenschaft auf true, aber das Verhalten, das ich sehe, ist nicht das, was ich will, ich will die Flowlayoutpanel auf die Breite der Tasten zu schrumpfen,
Ändern FlowDirection
bis UpToDown
ist keine Option.
Wer weiß, warum die AutoSize nicht funktioniert?
Dies ist der Code.
//
//FlowLayoutPanel1
//
this.FlowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.FlowLayoutPanel1.Controls.Add(this.FlowLayoutPanel3);
this.FlowLayoutPanel1.Location = new System.Drawing.Point(84, 77);
this.FlowLayoutPanel1.MinimumSize = new System.Drawing.Size(10, 10);
this.FlowLayoutPanel1.Name = "FlowLayoutPanel1";
this.FlowLayoutPanel1.Size = new System.Drawing.Size(308, 265);
this.FlowLayoutPanel1.TabIndex = 0;
//
//FlowLayoutPanel3
//
this.FlowLayoutPanel3.AutoSize = true;
this.FlowLayoutPanel3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.FlowLayoutPanel3.Controls.Add(this.Button1);
this.FlowLayoutPanel3.Controls.Add(this.Button2);
this.FlowLayoutPanel3.Controls.Add(this.Button3);
this.FlowLayoutPanel3.Location = new System.Drawing.Point(127, 3);
this.FlowLayoutPanel3.MinimumSize = new System.Drawing.Size(10, 10);
this.FlowLayoutPanel3.Name = "FlowLayoutPanel3";
this.FlowLayoutPanel3.Size = new System.Drawing.Size(162, 87);
this.FlowLayoutPanel3.TabIndex = 1;
//
//Button1
//
this.FlowLayoutPanel3.SetFlowBreak(this.Button1, true);
this.Button1.Location = new System.Drawing.Point(3, 3);
this.Button1.Name = "Button1";
this.Button1.Size = new System.Drawing.Size(75, 23);
this.Button1.TabIndex = 0;
this.Button1.Text = "Button1";
this.Button1.UseVisualStyleBackColor = true;
//
//Button2
//
this.FlowLayoutPanel3.SetFlowBreak(this.Button2, true);
this.Button2.Location = new System.Drawing.Point(3, 32);
this.Button2.Name = "Button2";
this.Button2.Size = new System.Drawing.Size(75, 23);
this.Button2.TabIndex = 1;
this.Button2.Text = "Button2";
this.Button2.UseVisualStyleBackColor = true;
//
//Button3
//
this.Button3.Location = new System.Drawing.Point(3, 61);
this.Button3.Name = "Button3";
this.Button3.Size = new System.Drawing.Size(75, 23);
this.Button3.TabIndex = 2;
this.Button3.Text = "Button3";
this.Button3.UseVisualStyleBackColor = true;
das ist das Problem in meinem GUI eine Steuer https://docs.google.com/document/d/1I6OtboresNk-gfOR3sEM8gyYHVX9sGohdNtX6heeQwI/edit?usp=sharing wenn i 2 Kontrollen setzen und setzt FlowBrake zu True https://docs.google.com/document/d/17C02PoL8LCyymfXNtEP8N6kkzZETxkiOCb6mPTbzGf0/edit?usp = sharing Ich möchte die Steuerelemente bleiben, aber wie die Breitenänderung nicht passt. – Natalia
Können Sie bitte zwei Bilder hinzufügen - eins mit dem, was Sie haben und eins mit dem, was Sie erreichen wollen. Aus der Textbeschreibung ist nicht klar, mit welchem Problem Sie konfrontiert werden –
Ich habe ein neues Bild mit dem Ergebnis hinzugefügt, und in meinem vorherigen Kommentar habe ich zwei Links mit dem Verhalten auf meiner GUI – Natalia