Пример #1
0
        private void _control_Load(object sender, EventArgs e)
        {
            LayoutHelper.AutoFitLabels(_labelSize);

            DisplayHelper.AutoFitSystemLabel(_labelOne, _labelOne.Width, int.MaxValue);
            DisplayHelper.AutoFitSystemButton(_previewButton, 0, int.MaxValue);

            if (_control.RightToLeft == RightToLeft.Yes)
            {
                _webImageUrl.Left  = _previewButton.Right + (int)DisplayHelper.ScaleX(WebImageUrlPadding);
                _webImageUrl.Width = _pictureBorder.Right - _previewButton.Right - (int)DisplayHelper.ScaleX(WebImageUrlPadding);

                _fileSize.Left  = _pictureBorder.Left;
                _fileSize.Width = _labelSize.Left - _fileSize.Left - SizeLabelPadding;
            }
            else
            {
                _webImageUrl.Left  = _pictureBorder.Left;
                _webImageUrl.Width = _previewButton.Left - _webImageUrl.Left - (int)DisplayHelper.ScaleX(WebImageUrlPadding);

                _fileSize.Left  = _labelSize.Right + SizeLabelPadding;
                _fileSize.Width = _pictureBorder.Right - _fileSize.Left;
            }

            BidiHelper.RtlLayoutFixup(_control);

            _webImageUrl.Select();
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!DesignMode)
            {
                LayoutHelper.FixupGroupBox(groupBoxTransportEncoding);
                LayoutHelper.FixupGroupBox(groupBoxXHTML);
                LayoutHelper.DistributeVertically((int)DisplayHelper.ScaleY(8), groupBoxTransportEncoding, groupBoxXHTML, groupBoxOptions);
                int delta = LayoutHelper.AutoFitLabels(lblEmbeds, lblScripts);
                comboEmbeds.Left   += delta;
                comboEmbeds.Width  -= delta;
                comboScripts.Left  += delta;
                comboScripts.Width -= delta;
            }
        }
Пример #3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            using (new AutoGrow(this, AnchorStyles.Right, false))
            {
                using (new AutoGrow(gbTableHeader, AnchorStyles.Right, false))
                {
                    labelWordCount.AutoSize     = true;
                    labelCharsNoSpaces.AutoSize = true;
                    labelChars.AutoSize         = true;
                    labelParagraphs.AutoSize    = true;

                    LayoutHelper.AutoFitLabels(labelWordCountValue, labelCharsNoSpacesValue, labelCharsValue, labelParagraphsValue);
                }
            }

            DisplayHelper.AutoFitSystemButton(buttonClose, buttonClose.Width, int.MaxValue);
        }
Пример #4
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            Label[]         leftLabels  = { label1, label2, label8, label7, label12, label11 };
            NumericUpDown[] values      = { numericSmallWidth, numericSmallHeight, numericMediumWidth, numericMediumHeight, numericLargeWidth, numericLargeHeight };
            Label[]         rightLabels = { label3, label4, label6, label5, label10, label9 };

            using (AutoGrow autoGrow = new AutoGrow(this, AnchorStyles.Right, false))
            {
                autoGrow.AllowAnchoring = true;

                int deltaX = LayoutHelper.AutoFitLabels(leftLabels);
                new ControlGroup(values).Left      += deltaX;
                new ControlGroup(rightLabels).Left += deltaX;
                LayoutHelper.AutoFitLabels(rightLabels);

                LayoutHelper.FixupOKCancel(buttonOK, buttonCancel);
            }
        }
Пример #5
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            LayoutHelper.AutoFitLabels(label1, label2);
            LayoutHelper.DistributeHorizontally(8, label1, label2);
            LayoutHelper.DistributeHorizontally(8, textBoxWidth, textBoxHeight);
            if (label2.Left > textBoxHeight.Left)
            {
                textBoxHeight.Left = label2.Left;
            }
            else
            {
                label2.Left = textBoxHeight.Left;
            }

            textBoxWidth.Left  = label1.Left;
            textBoxHeight.Left = label2.Left;

            LayoutHelper.NaturalizeHeightAndDistribute(3, new ControlGroup(imageSizePickerControl1, buttonCustomize), new ControlGroup(label1, label2));
            LayoutHelper.NaturalizeHeightAndDistribute(3, new ControlGroup(label1, label2), new ControlGroup(textBoxHeight, textBoxWidth), cbConstrainRatio);
        }