protected override void OnLoad(EventArgs e) { base.OnLoad(e); using (new AutoGrow(this, AnchorStyles.Bottom, true)) { LayoutHelper.NaturalizeHeightAndDistribute(8, labelTitle, labelUnableToRetrieve, labelCanStillEditLocally); LayoutHelper.DistributeVertically(12, false, labelCanStillEditLocally, buttonOK); } }
public override void NaturalizeLayout() { if (!DesignMode) { MaximizeWidth(labelSelectWeblog); LayoutHelper.NaturalizeHeight(labelSelectWeblog); LayoutHelper.NaturalizeHeight(labelHeader); LayoutHelper.DistributeVertically(10, labelSelectWeblog, listBoxSelectWeblog); } }
public override void NaturalizeLayout() { if (!DesignMode) { MaximizeWidth(labelDescription); LayoutHelper.NaturalizeHeight(labelDescription); LayoutHelper.DistributeVertically(10, false, labelDescription, buttonLogin); } }
protected override void OnLoad(EventArgs e) { using (new AutoGrow(this, AnchorStyles.None, false)) { DisplayHelper.AutoFitSystemLabel(label1, label1.Width, label1.Width); LayoutHelper.DistributeVertically(8, label1, newFolderName, new ControlGroup(buttonOK, buttonCancel)); LayoutHelper.FixupOKCancel(buttonOK, buttonCancel); } base.OnLoad(e); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); using (new AutoGrow(this, AnchorStyles.Bottom, true)) { LayoutHelper.NaturalizeHeightAndDistribute(4, label1, linkLabel1); LayoutHelper.DistributeVertically(12, false, linkLabel1, picCaptcha); LayoutHelper.DistributeVertically(4, picCaptcha, txtCaptcha); LayoutHelper.DistributeVertically(12, false, txtCaptcha, new ControlGroup(btnOK, btnCancel)); LayoutHelper.FixupOKCancel(btnOK, btnCancel); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); int origY = label2.Bottom; LayoutHelper.NaturalizeHeight(label1, label2); LayoutHelper.DistributeVertically(12, new ControlGroup(rdPlainText, label1), new ControlGroup(rdFormatted, label2)); Height += Math.Max(0, label2.Bottom - origY); LayoutHelper.FixupOKCancel(btnOK, btnCancel); }
public override void NaturalizeLayout() { if (!DesignMode) { MaximizeWidth(labelUsername); MaximizeWidth(labelPassword); MaximizeWidth(checkBoxSavePassword); MaximizeWidth(cbUseSystemLogin); LayoutHelper.NaturalizeHeight(labelUsername, labelPassword, checkBoxSavePassword, cbUseSystemLogin); LayoutHelper.DistributeVertically(10, false, cbUseSystemLogin, labelUsername); LayoutHelper.DistributeVertically(3, false, labelUsername, textBoxUsername); LayoutHelper.DistributeVertically(10, false, textBoxUsername, labelPassword); LayoutHelper.DistributeVertically(3, false, labelPassword, textBoxPassword, checkBoxSavePassword); } }
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; } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); using (new AutoGrow(this, AnchorStyles.Bottom, true)) { LayoutHelper.NaturalizeHeightAndDistribute(16, labelBody, new ControlGroup(buttonOk, buttonCancel)); LayoutHelper.FixupOKCancel(buttonOk, buttonCancel); if (buttonOk.Left < labelBody.Left) { // go to over/under LayoutHelper.DistributeVertically(10, false, buttonOk, buttonCancel); buttonOk.Left = buttonCancel.Left = labelBody.Left; } } }
public override void NaturalizeLayout() { if (!DesignMode) { MaximizeWidth(labelHomepageUrl); MaximizeWidth(labelHomepageUrl2); MaximizeWidth(checkBoxSavePassword); LayoutHelper.NaturalizeHeightAndDistribute(3, labelHomepageUrl, textBoxHomepageUrl, labelHomepageUrl2); LayoutHelper.NaturalizeHeightAndDistribute(3, labelUsername, textBoxUsername); LayoutHelper.NaturalizeHeightAndDistribute(3, labelPassword, textBoxPassword, checkBoxSavePassword); LayoutHelper.DistributeVertically(10, false, new ControlGroup(labelHomepageUrl, textBoxHomepageUrl, labelHomepageUrl2), new ControlGroup(labelUsername, textBoxUsername), new ControlGroup(labelPassword, textBoxPassword, checkBoxSavePassword) ); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); using (new AutoGrow(this, AnchorStyles.Bottom, true)) { DisplayHelper.AutoFitSystemButton(buttonYes, buttonYes.Width, int.MaxValue); DisplayHelper.AutoFitSystemButton(buttonNo, buttonNo.Width, int.MaxValue); LayoutHelper.DistributeHorizontally(8, buttonYes, buttonNo); LayoutHelper.NaturalizeHeight(labelError, labelExplanation, cbDontShowAgain); LayoutHelper.DistributeVertically(12, labelError, labelExplanation, new ControlGroup(buttonYes, buttonNo), cbDontShowAgain); cbDontShowAgain.Left = labelError.Left; } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!DesignMode) { DisplayHelper.AutoFitSystemButton(buttonUpdateStyle); // add some padding to the button, otherwise it looks crowded buttonUpdateStyle.Width += (int)Math.Ceiling(DisplayHelper.ScaleX(14)); comboBoxRTL.Left = buttonUpdateStyle.Left + 1; LayoutHelper.FixupGroupBox(groupBoxWeblogStyle); LayoutHelper.FixupGroupBox(groupBoxRTL); LayoutHelper.DistributeVertically(8, groupBoxWeblogStyle, groupBoxRTL); int maxWidth = groupBoxRTL.Width - comboBoxRTL.Left - 8; DisplayHelper.AutoFitSystemCombo(comboBoxRTL, comboBoxRTL.Width, maxWidth, false); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); using (new AutoGrow(this, AnchorStyles.Bottom | AnchorStyles.Right, true)) { pictureBoxLogo.Left = labelCopyright.Left; labelProduct.Left = pictureBoxLogo.Right + 10; labelVersion.Left = pictureBoxLogo.Right + 10; LayoutHelper.NaturalizeHeight(labelProduct); labelProduct.Top = pictureBoxLogo.Top + (pictureBoxLogo.Height / 2) - labelProduct.Height; LayoutHelper.DistributeVertically(15, false, labelProduct, labelVersion); LayoutHelper.NaturalizeHeightAndDistribute(8, labelVersion, labelCopyright); LayoutHelper.FitControlsBelow(10, labelCopyright); DisplayHelper.AutoFitSystemButton(buttonOK, buttonOK.Width, int.MaxValue); } }
private void RefreshLayout() { if (_auth == null) { return; } SuspendLayout(); ckBoxSavePassword.Width = Width - ckBoxSavePassword.Left - 10; linkLabelCreateMicrosoftAccountID.Width = Width - linkLabelCreateMicrosoftAccountID.Left - 10; LayoutHelper.NaturalizeHeight(pictureBoxLogo, lblUsername, txtUsername, lblEmailExample, lblPassword, txtPassword, ckBoxSavePassword, linkLabelCreateMicrosoftAccountID, linkLabelPrivacy, btnLogin); if (ShowCreateMicrosoftAccountID) { LayoutHelper.DistributeVertically(4, false, pictureBoxLogo, lblUsername, txtUsername, lblEmailExample, lblPassword, txtPassword, ckBoxSavePassword, linkLabelCreateMicrosoftAccountID, linkLabelPrivacy, btnLogin); } else { LayoutHelper.DistributeVertically(4, false, pictureBoxLogo, lblUsername, txtUsername, lblEmailExample, lblPassword, txtPassword, ckBoxSavePassword, btnLogin); } ckBoxSavePassword.Visible = _auth.AllowSavePassword; lblUsername.Width = lblPassword.Width = lblEmailExample.Width = txtUsername.Width; lblUsername.Left = lblPassword.Left = lblEmailExample.Left = txtUsername.Left; if (BidiHelper.IsRightToLeft) { pictureBoxLogo.Left = txtUsername.Right - pictureBoxLogo.Width; } else { pictureBoxLogo.Left = txtUsername.Left; } Controls.Remove(lblStatus); DisplayHelper.AutoFitSystemButton(btnLogin, btnLogin.Width, int.MaxValue); LayoutHelper.FitControlsBelow(10, pictureBoxLogo); LayoutHelper.NaturalizeHeightAndDistribute(3, lblUsername, txtUsername, lblEmailExample); LayoutHelper.FitControlsBelow(10, lblEmailExample); if (ShowCreateMicrosoftAccountID) { LayoutHelper.NaturalizeHeightAndDistribute(3, lblPassword, txtPassword, ckBoxSavePassword); LayoutHelper.NaturalizeHeightAndDistribute(15, ckBoxSavePassword, new ControlGroup(linkLabelCreateMicrosoftAccountID, linkLabelPrivacy), btnLogin); } else { LayoutHelper.NaturalizeHeightAndDistribute(3, lblPassword, txtPassword, ckBoxSavePassword); LayoutHelper.NaturalizeHeightAndDistribute(15, ckBoxSavePassword, btnLogin); } if (BidiHelper.IsRightToLeft) { btnLogin.Left = txtPassword.Left; ckBoxSavePassword.Left = txtPassword.Right - ckBoxSavePassword.Width; linkLabelCreateMicrosoftAccountID.Left = txtPassword.Right - linkLabelCreateMicrosoftAccountID.Width; linkLabelPrivacy.Left = txtPassword.Right - linkLabelPrivacy.Width; } else { btnLogin.Left = txtPassword.Right - btnLogin.Width; ckBoxSavePassword.Left = linkLabelCreateMicrosoftAccountID.Left = linkLabelPrivacy.Left = txtPassword.Left; linkLabelCreateMicrosoftAccountID.Left -= 2; linkLabelPrivacy.Left -= 2; } Controls.Add(lblStatus); ResumeLayout(); }