alternetsoft / AlternetUI

MIT License
26 stars 2 forks source link

Why does this have many diffrent options to add a control to another? #138

Closed Shadowblitz16 closed 3 weeks ago

Shadowblitz16 commented 3 weeks ago

These should be unified. Right now it's really hard to build ui in C# because if we use the wrong method it doesn't get laid out properly.

generalloki commented 3 weeks ago

I am moving this to discussions. Here is the proper way to add one control to another:

            var editor = new TextBox();
            editor.Parent = someParent;

Also you can disable/enable layout:

            someParent.SuspendLayout();

            var editor = new TextBox();
            editor.Parent = someParent;

            var button = new Button();
            button.Parent = someParent;

            someParent.ResumeLayout();