diff --git a/PROMS/VEPROMS User Interface/frmPSI.cs b/PROMS/VEPROMS User Interface/frmPSI.cs index 2eb5cc65..535400d3 100644 --- a/PROMS/VEPROMS User Interface/frmPSI.cs +++ b/PROMS/VEPROMS User Interface/frmPSI.cs @@ -108,12 +108,22 @@ namespace VEPROMS this.panelPSI.AutoScroll = true; } else - this.panelPSI.Height = maxy + 50; + this.panelPSI.Height = maxy; // B2018-062: Ok/Cancel buttons not displayed if more than a few labels/fields are defined. if (psiDialogDef.ButtonsOnBottom == null || psiDialogDef.ButtonsOnBottom.ToUpper() == "NO") { btnOk.Location = new Point(maxx+70, 30); btnCancel.Location = new Point(maxx + 70, 60); } + else if (btnOk.Location.Y < panelPSI.Location.Y + panelPSI.Height) + { + // B2018-062: Ok/Cancel buttons not displayed if more than a few labels/fields are defined: + // Adjust location of buttons so that they have a larger Y than the panel that holds the labels/fields + // and adjust the dialog size if it's height is not enough. + btnOk.Location = new Point(btnOk.Location.X, panelPSI.Location.Y + this.panelPSI.Height + 10); + btnCancel.Location = new Point(btnCancel.Location.X, panelPSI.Location.Y + this.panelPSI.Height + 10); + if (this.Height < btnOk.Location.Y + btnOk.Size.Height + 10) + this.Height = btnOk.Location.Y + btnOk.Size.Height + 30; + } } private void FieldStepRTB_Enter(object sender, EventArgs e) {