Пример #1
0
        private void InitControls(string text)
        {
            int margin = 10;

            Button okButton = new Button();

            okButton.Text = "Ok";
            LayoutHelper.Bottom(this, margin).CenterWidth(this, 50).Height(20).Apply(okButton);
            okButton.Click += new EventHandler(OkButton_OnClick);

            Label label = new Label();

            LayoutHelper.Above(okButton, margin).Left(this, margin).Top(this, margin).Right(this, margin).Apply(label);
            label.Text = text;

            this.Controls.Add(label);
            this.Controls.Add(okButton);
        }
Пример #2
0
        private void InitControls(string text)
        {
            int margin = 10;

            okButton        = new Button();
            okButton.Text   = "OK";
            okButton.Dock   = DockStyle.Bottom;
            okButton.Click += new EventHandler(OkButton_OnClick);
            this.Controls.Add(okButton);

            TextBox textBox = new TextBox();

            LayoutHelper.Above(okButton, margin).Left(this, margin).Top(this, margin).Right(this, margin).Apply(textBox);
            textBox.Anchor     = LayoutHelper.AnchorAll;
            textBox.Multiline  = true;
            textBox.WordWrap   = true;
            textBox.ReadOnly   = true;
            textBox.ScrollBars = ScrollBars.Vertical;
            textBox.Text       = text;
            this.Controls.Add(textBox);
        }