Пример #1
0
        public StatusPanel()
        {
            label          = new Label();
            label.AutoSize = true;
            label.Location = new Point(margin, margin);
            label.Anchor   = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Bottom;
            label.Text     = "";
            this.Controls.Add(label);

            progressBar      = new ProgressBar();
            progressBar.Size = new Size(100, label.Height);
            LayoutHelper.PlaceRightOf(progressBar, label, margin);
            this.Controls.Add(progressBar);

            cancelButton          = new Button();
            cancelButton.Text     = "Cancel";
            cancelButton.AutoSize = true;
            LayoutHelper.PlaceRightOf(cancelButton, progressBar, margin);
            cancelButton.Click += new EventHandler(OnCancel);
            this.Controls.Add(cancelButton);

            this.Height = cancelButton.Height + (2 * margin);
            LayoutHelper.CenterVertically(label, this);
            LayoutHelper.CenterVertically(progressBar, this);
            LayoutHelper.CenterVertically(cancelButton, this);

            HideProgressBar();
        }