0

Is it possible to create an Inline-flexbox equivalent in .NET Winforms that is driven by various Combobox and Checkbox Controls on a Windows form? I dont need something too sophisticated, perhaps 6 at most of these buttons with curved edges that just stack inline as they are added and sized to the text within the button.

this is an example you can add many of these filters and remove them by clicking the X

TytoCoder
  • 3
  • 4
  • Did you take a look at `FlowLayoutPanel`? `FlowLayoutPanel` can be used to stack controls one after another, the alignment is done by the control itself. – Sideways Apr 13 '21 at 10:45
  • Thanx will take a look now. Needs to be able to add or remove controls without a fixed order. I just found this post on Stack overflow "Add controls dynamically in flowlayoutpanel" ... https://stackoverflow.com/questions/16900522/add-controls-dynamically-in-flowlayoutpanel – TytoCoder Apr 14 '21 at 10:58

1 Answers1

0

This is from the hyperlink and inserts dynamically controls hence does what I need you helped a great deal sideways. Shouldn't we be using tabs instead of spaces as it causes problem in code?

for (int i = 0; i < 5; i++)
{
Button button = new Button();
button.Tag = i;
flowLayoutPanel1.Controls.Add(button);
}
TytoCoder
  • 3
  • 4
  • Glad you solved it! If you paste the code in your IDE, it normally handles all the text alignment for you, so it should insert tabs. But even if not, C# code is not sensitive to tabs or spaces as, for example, YAML. – Sideways Apr 14 '21 at 17:54