Example #1
0
        public ContainerTest(ControlBase parent) : base(parent)
        {
            GroupBox gb = new GroupBox(parent);

            gb.Text   = "group box";
            gb.Width  = 120;
            gb.Height = 120;
            gb.AddChild(new Button(null)
            {
                Text = "Button"
            });

            Panel panel = new Panel(parent)
            {
                Children =
                {
                    new FlowLayout(null)
                    {
                        Children =
                        {
                            new Label(null)
                            {
                                Text = "A label in a panel"
                            },
                            new Button(null)
                            {
                                Text = "A button in a panel",
                            }
                        },
                        Dock = Dock.Fill
                    }
                },
            };

            panel.SetBounds(130, 130, 150, 150);
            ScrollControl sc = new ScrollControl(parent)
            {
                Children =
                {
                    new Label(null)
                    {
                        Text = "Scroll control"
                    },
                    new Button(null)
                    {
                        X    = 180,
                        Y    = 180,
                        Text = "Scroll to me"
                    },
                    new Button(null)
                    {
                        X    = 180,
                        Y    = 380,
                        Text = "No, scroll to me."
                    },
                }
            };

            sc.SetBounds(0, 300, 200, 200);
            VerticalScrollBar vs = new VerticalScrollBar(sc);

            vs.NudgeAmount         = 30;
            vs.ViewableContentSize = 10;
            vs.ContentSize         = 120;
            vs.Disable();
            vs.Height = 100;
            vs.Y     += 20;
        }