From a252b4da5bd5866fb6426133207a1993dd3ccb43 Mon Sep 17 00:00:00 2001 From: Kathy Date: Thu, 24 May 2018 14:32:58 +0000 Subject: [PATCH] B2018-062: PSI OK/Cancel buttons not visible on bottom if more than a few labels/values --- PROMS/VEPROMS User Interface/frmPSI.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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) {